private addStackTemplateToAssetManifest()

in src/index.ts [346:365]


  private addStackTemplateToAssetManifest(_: ISynthesisSession) {
    assertNotNull(this.stack, ERR_MSG_CALL_BIND_FIRST);

    const sourceHash = this.stack.templateFile;

    this._addFileAsset({
      fileName: this.stack.templateFile,
      packaging: FileAssetPackaging.FILE,
      sourceHash,
    }, this.templateBucketName);

    // We should technically return an 'https://s3.REGION.amazonaws.com[.cn]/name/hash' URL here,
    // because that is what CloudFormation expects to see.
    //
    // However, there's no way for us to actually know the UrlSuffix a priori, so we can't construct it here.
    //
    // Instead, we'll have a protocol with the CLI that we put an 's3://.../...' URL here, and the CLI
    // is going to resolve it to the correct 'https://.../' URL before it gives it to CloudFormation.
    return `s3://${this.bucketName}/${sourceHash}`;
  }