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

- Source: [`core/lib/stack-synthesizers/asset-manifest-builder.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/stack-synthesizers/asset-manifest-builder.ts#L19)
- Type last changed: v2.187.0 · 31 Mar 2025

## Example

TypeScript:

```ts
// 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();
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

asset_manifest_builder = cdk.AssetManifestBuilder()
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

AssetManifestBuilder assetManifestBuilder = new AssetManifestBuilder();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var assetManifestBuilder = new AssetManifestBuilder();
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

assetManifestBuilder := cdk.NewAssetManifestBuilder()
```

## Initializer

TypeScript:

```ts
new AssetManifestBuilder()
```

Python:

```python
AssetManifestBuilder()
```

Java:

```java
new AssetManifestBuilder()
```

C# / .NET:

```csharp
new AssetManifestBuilder()
```

Golang:

```go
NewAssetManifestBuilder()
```

## Properties

- `hasAssets`: boolean — Whether there are any assets registered in the manifest.

## Methods

- `addDockerImageAsset(stack: Stack, sourceHash: string, source: DockerImageSource, dest: DockerImageDestination, options?: AddDockerImageAssetOptions): DockerImageDestination` — Add a docker asset source and destination to the manifest.

  sourceHash should be unique for every source.

- `addFileAsset(stack: Stack, sourceHash: string, source: FileSource, dest: FileDestination, options?: AddFileAssetOptions): FileDestination` — Add a file asset source and destination to the manifest.

  sourceHash should be unique for every source.

- `defaultAddDockerImageAsset(stack: Stack, asset: DockerImageAssetSource, target: AssetManifestDockerImageDestination, options?: AddDockerImageAssetOptions): 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: Stack, asset: FileAssetSource, target: AssetManifestFileDestination, options?: AddFileAssetOptions): 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: 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.
