private uploadInteractionsLexZip()

in src/export-backend-asset-handler/index.ts [182:220]


  private uploadInteractionsLexZip(resourceName: string): BucketDeployment {
    const filePath = path.join(
      this.exportPath,
      INTERACTIONS_CATEGORY.NAME,
      resourceName,
      AMPLIFY_BUILDS,
    );

    const buildFile = path.join(
      filePath,
      this.validateFilesAndReturnPath(filePath),
    );


    const deployment = new BucketDeployment(
      this,
      `${resourceName}-deployment`,
      {
        destinationBucket: this.deploymentBucket,
        sources: [Source.asset(filePath)],
        destinationKeyPrefix: AMPLIFY_BUILDS,
        prune: false,
      },
    );
    const stacks = this.exportManifest.props.loadNestedStacks;
    const logicalId = `${INTERACTIONS_CATEGORY.NAME}${resourceName}`;

    if (stacks) {
      const parameters = stacks[logicalId].parameters;
      if (parameters) {
        parameters[STACK_PARAMETERS.FUNCTION.DEPLOYMENT_BUCKET_NAME] =
          this.deploymentBucket.bucketName;
        parameters[
          STACK_PARAMETERS.FUNCTION.S3_KEY
        ] = `${AMPLIFY_BUILDS}/${path.basename(buildFile)}`;
      }
    }
    return deployment;
  }