Skip to content

AssetManifestBuilder

Build an asset manifest from assets added to a stack.

This class does not need to be used by app builders; it is only necessary for building Stack Synthesizers.

Initializers

import { AssetManifestBuilder } from '@alicloud/ros-cdk-core'
new AssetManifestBuilder()
Name Type Description

Methods

Name Description
addDockerImageAsset Add a docker asset source and destination to the manifest.
addFileAsset Add a file asset source and destination to the manifest.
defaultAddDockerImageAsset Add a docker image asset to the manifest with default settings.
defaultAddFileAsset Add a file asset to the manifest with default settings.
emitManifest Write the manifest to disk, and add it to the synthesis session.

addDockerImageAsset

public addDockerImageAsset(stack: Stack, sourceHash: string, source: DockerImageSource, dest: DockerImageDestination): DockerImageDestination

Add a docker asset source and destination to the manifest.

sourceHash should be unique for every source.

stackRequired


sourceHashRequired

  • Type: string

sourceRequired

  • Type: @alicloud/ros-cdk-assembly-schema.DockerImageSource

destRequired

  • Type: @alicloud/ros-cdk-assembly-schema.DockerImageDestination

addFileAsset

public addFileAsset(stack: Stack, sourceHash: string, source: FileSource, dest: FileDestination): FileDestination

Add a file asset source and destination to the manifest.

sourceHash should be unique for every source.

stackRequired


sourceHashRequired

  • Type: string

sourceRequired

  • Type: @alicloud/ros-cdk-assembly-schema.FileSource

destRequired

  • Type: @alicloud/ros-cdk-assembly-schema.FileDestination

defaultAddDockerImageAsset

public defaultAddDockerImageAsset(stack: Stack, asset: DockerImageAssetSource, target: AssetManifestDockerImageDestination): DockerImageDestination

Add a docker image asset to the manifest with default settings.

Derive the region from the stack, use the asset hash as the key, and set the prefix.

stackRequired


assetRequired


targetRequired


defaultAddFileAsset

public defaultAddFileAsset(stack: Stack, asset: FileAssetSource, target: AssetManifestFileDestination): FileDestination

Add a file asset to the manifest with default settings.

Derive the region from the stack, use the asset hash as the key, copy the file extension over, and set the prefix.

stackRequired


assetRequired


targetRequired


emitManifest

public emitManifest(stack: Stack, session: ISynthesisSession, options?: AssetManifestOptions, dependencies?: string[]): string

Write the manifest to disk, and add it to the synthesis session.

Return the artifact id, which should be added to the additionalDependencies field of the stack artifact.

stackRequired


sessionRequired


optionsOptional

  • Type: @alicloud/ros-cdk-assembly-schema.AssetManifestOptions

dependenciesOptional

  • Type: string[]

Properties

Name Type Description
hasAssets boolean Whether there are any assets registered in the manifest.

hasAssetsRequired

public readonly hasAssets: boolean;
  • Type: boolean

Whether there are any assets registered in the manifest.