aws-cdk-lib.AssetManifestBuilder

class AssetManifestBuilder

LanguageType name
.NETAmazon.CDK.AssetManifestBuilder
Gogithub.com/aws/aws-cdk-go/awscdk/v2#AssetManifestBuilder
Javasoftware.amazon.awscdk.AssetManifestBuilder
Pythonaws_cdk.AssetManifestBuilder
TypeScript (source)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

NameTypeDescription
hasAssetsbooleanWhether there are any assets registered in the manifest.

hasAssets

Type: boolean

Whether there are any assets registered in the manifest.

Methods

NameDescription
addDockerImageAsset(stack, sourceHash, source, dest)Add a docker asset source and destination to the manifest.
addFileAsset(stack, sourceHash, source, dest)Add a file asset source and destination to the manifest.
defaultAddDockerImageAsset(stack, asset, target)Add a docker image asset to the manifest with default settings.
defaultAddFileAsset(stack, asset, target)Add a file asset to the manifest with default settings.
emitManifest(stack, session, options?, dependencies?)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 DockerImageSource
  • dest DockerImageDestination

Returns

  • DockerImageDestination

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 FileSource
  • dest FileDestination

Returns

  • FileDestination

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 DockerImageAssetSource
  • target AssetManifestDockerImageDestination

Returns

  • 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.


defaultAddFileAsset(stack, asset, target)

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

Parameters

  • stack Stack
  • asset FileAssetSource
  • target AssetManifestFileDestination

Returns

  • 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.


emitManifest(stack, session, options?, dependencies?)

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

Parameters

  • stack Stack
  • session ISynthesisSession
  • options AssetManifestOptions
  • 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.