class AssetManifestBuilder
Language | Type name |
---|---|
![]() | Amazon.CDK.AssetManifestBuilder |
![]() | github.com/aws/aws-cdk-go/awscdk/v2#AssetManifestBuilder |
![]() | software.amazon.awscdk.AssetManifestBuilder |
![]() | aws_cdk.AssetManifestBuilder |
![]() | aws-cdk-lib » 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.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const assetManifestBuilder = new cdk.AssetManifestBuilder();
Initializer
new AssetManifestBuilder()
Properties
Name | Type | Description |
---|---|---|
has | boolean | Whether there are any assets registered in the manifest. |
hasAssets
Type:
boolean
Whether there are any assets registered in the manifest.
Methods
Name | Description |
---|---|
add | Add a docker asset source and destination to the manifest. |
add | Add a file asset source and destination to the manifest. |
default | Add a docker image asset to the manifest with default settings. |
default | Add a file asset to the manifest with default settings. |
emit | Write the manifest to disk, and add it to the synthesis session. |
addDockerImageAsset(stack, sourceHash, source, dest)
public addDockerImageAsset(stack: Stack, sourceHash: string, source: DockerImageSource, dest: DockerImageDestination): DockerImageDestination
Parameters
- stack
Stack
- sourceHash
string
- source
Docker
Image Source - dest
Docker
Image Destination
Returns
Add a docker asset source and destination to the manifest.
sourceHash should be unique for every source.
addFileAsset(stack, sourceHash, source, dest)
public addFileAsset(stack: Stack, sourceHash: string, source: FileSource, dest: FileDestination): FileDestination
Parameters
- stack
Stack
- sourceHash
string
- source
File
Source - dest
File
Destination
Returns
Add a file asset source and destination to the manifest.
sourceHash should be unique for every source.
defaultAddDockerImageAsset(stack, asset, target)
public defaultAddDockerImageAsset(stack: Stack, asset: DockerImageAssetSource, target: AssetManifestDockerImageDestination): DockerImageDestination
Parameters
- stack
Stack
- asset
Docker
Image Asset Source - target
Asset
Manifest Docker Image Destination
Returns
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.
defaultAddFileAsset(stack, asset, target)
public defaultAddFileAsset(stack: Stack, asset: FileAssetSource, target: AssetManifestFileDestination): FileDestination
Parameters
- stack
Stack
- asset
File
Asset Source - target
Asset
Manifest File Destination
Returns
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.
emitManifest(stack, session, options?, dependencies?)
public emitManifest(stack: Stack, session: ISynthesisSession, options?: AssetManifestOptions, dependencies?: string[]): string
Parameters
- stack
Stack
- session
ISynthesis
Session - options
Asset
Manifest Options - dependencies
string[]
Returns
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.