private uploadLambdaLayerZips()

in src/export-backend-asset-handler/index.ts [260:288]


  private uploadLambdaLayerZips(resourceName: string): BucketDeployment {
    const filePath = path.join(
      this.exportPath,
      FUNCTION_CATEGORY.NAME,
      resourceName,
      AMPLIFY_BUILDS,
    );
    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 = `${FUNCTION_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;
      }
    }
    return deployment;
  }