# NestedStackSynthesizer

Synthesizer for a nested stack.

Forwards all calls to the parent stack's synthesizer.

This synthesizer is automatically used for `NestedStack` constructs.
App builder do not need to use this class directly.

Extends: [StackSynthesizer](/cdk/api/v2/docs/aws-cdk-lib.StackSynthesizer.html) › NestedStackSynthesizer
Implements: [IStackSynthesizer](/cdk/api/v2/docs/aws-cdk-lib.IStackSynthesizer.html)

- Source: [`core/lib/stack-synthesizers/nested.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/core/lib/stack-synthesizers/nested.ts#L13)
- Type last changed: v2.253.1 · 8 May 2026

## 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';

declare const stackSynthesizer: cdk.StackSynthesizer;
const nestedStackSynthesizer = new cdk.NestedStackSynthesizer(stackSynthesizer);
```

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

# stack_synthesizer: cdk.StackSynthesizer

nested_stack_synthesizer = cdk.NestedStackSynthesizer(stack_synthesizer)
```

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.*;

StackSynthesizer stackSynthesizer;

NestedStackSynthesizer nestedStackSynthesizer = new NestedStackSynthesizer(stackSynthesizer);
```

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;

StackSynthesizer stackSynthesizer;

var nestedStackSynthesizer = new NestedStackSynthesizer(stackSynthesizer);
```

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"

var stackSynthesizer StackSynthesizer

nestedStackSynthesizer := cdk.NewNestedStackSynthesizer(stackSynthesizer)
```

## Initializer

TypeScript:

```ts
new NestedStackSynthesizer(parentDeployment: IStackSynthesizer)
```

Python:

```python
NestedStackSynthesizer(parent_deployment: IStackSynthesizer)
```

Java:

```java
new NestedStackSynthesizer(IStackSynthesizer parentDeployment)
```

C# / .NET:

```csharp
new NestedStackSynthesizer(IStackSynthesizer parentDeployment)
```

Golang:

```go
NewNestedStackSynthesizer(ParentDeployment IStackSynthesizer)
```

## Properties

- `bootstrapQualifier`: string — The qualifier used to bootstrap this stack.

- `cloudFormationExecutionRole`: string — The role that is passed to CloudFormation to execute the change set.

- `lookupRole`: string — The role used to lookup for this stack.

## Methods

- `addDockerImageAsset(asset: DockerImageAssetSource): DockerImageAssetLocation` — Register a Docker Image Asset.

  Returns the parameters that can be used to refer to the asset inside the template.

  The synthesizer must rely on some out-of-band mechanism to make sure the given files
  are actually placed in the returned location before the deployment happens. This can
  be by writing the instructions to the asset manifest (for use by the `cdk-assets` tool),
  by relying on the CLI to upload files (legacy behavior), or some other operator controlled
  mechanism.

- `addFileAsset(asset: FileAssetSource): FileAssetLocation` — Register a File Asset.

  Returns the parameters that can be used to refer to the asset inside the template.

  The synthesizer must rely on some out-of-band mechanism to make sure the given files
  are actually placed in the returned location before the deployment happens. This can
  be by writing the instructions to the asset manifest (for use by the `cdk-assets` tool),
  by relying on the CLI to upload files (legacy behavior), or some other operator controlled
  mechanism.

- `bind(stack: Stack): void` — Bind to the stack this environment is going to be used on.

  Must be called before any of the other methods are called.

- `synthesize(session: ISynthesisSession): void` — Synthesize the associated stack to the session.
