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.
- Type: Stack
- Type: string
- Type: @alicloud/ros-cdk-assembly-schema.DockerImageSource
- 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.
- Type: Stack
- Type: string
- Type: @alicloud/ros-cdk-assembly-schema.FileSource
- 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.
- Type: Stack
- Type: DockerImageAssetSource
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.
- Type: Stack
- Type: FileAssetSource
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.
- Type: Stack
- Type: ISynthesisSession
- Type: @alicloud/ros-cdk-assembly-schema.AssetManifestOptions
- Type: string[]
Properties
Name | Type | Description |
---|---|---|
hasAssets |
boolean |
Whether there are any assets registered in the manifest. |
hasAssets
Required
public readonly hasAssets: boolean;
- Type: boolean
Whether there are any assets registered in the manifest.