NestedStackSynthesizer

class aws_cdk.NestedStackSynthesizer(parent_deployment)

Bases: StackSynthesizer

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.

ExampleMetadata:

fixture=_generated

Example:

# 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)
Parameters:

parent_deployment (IStackSynthesizer) –

Methods

add_docker_image_asset(*, source_hash, asset_name=None, directory_name=None, docker_build_args=None, docker_build_secrets=None, docker_build_ssh=None, docker_build_target=None, docker_cache_disabled=None, docker_cache_from=None, docker_cache_to=None, docker_file=None, docker_outputs=None, executable=None, network_mode=None, platform=None)

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.

Parameters:
  • source_hash (str) – The hash of the contents of the docker build context. This hash is used throughout the system to identify this image and avoid duplicate work in case the source did not change. NOTE: this means that if you wish to update your docker image, you must make a modification to the source (e.g. add some metadata to your Dockerfile).

  • asset_name (Optional[str]) – Unique identifier of the docker image asset and its potential revisions. Required if using AppScopedStagingSynthesizer. Default: - no asset name

  • directory_name (Optional[str]) – The directory where the Dockerfile is stored, must be relative to the cloud assembly root. Default: - Exactly one of directoryName and executable is required

  • docker_build_args (Optional[Mapping[str, str]]) – Build args to pass to the docker build command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl). Only allowed when directoryName is specified. Default: - no build args are passed

  • docker_build_secrets (Optional[Mapping[str, str]]) – Build secrets to pass to the docker build command. Since Docker build secrets are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl). Only allowed when directoryName is specified. Default: - no build secrets are passed

  • docker_build_ssh (Optional[str]) – SSH agent socket or keys to pass to the docker buildx command. Default: - no ssh arg is passed

  • docker_build_target (Optional[str]) – Docker target to build to. Only allowed when directoryName is specified. Default: - no target

  • docker_cache_disabled (Optional[bool]) – Disable the cache and pass --no-cache to the docker build command. Default: - cache is used

  • docker_cache_from (Optional[Sequence[Union[DockerCacheOption, Dict[str, Any]]]]) – Cache from options to pass to the docker build command. Default: - no cache from args are passed

  • docker_cache_to (Union[DockerCacheOption, Dict[str, Any], None]) – Cache to options to pass to the docker build command. Default: - no cache to args are passed

  • docker_file (Optional[str]) – Path to the Dockerfile (relative to the directory). Only allowed when directoryName is specified. Default: - no file

  • docker_outputs (Optional[Sequence[str]]) – Outputs to pass to the docker build command. Default: - no build args are passed

  • executable (Optional[Sequence[str]]) – An external command that will produce the packaged asset. The command should produce the name of a local Docker image on stdout. Default: - Exactly one of directoryName and executable is required

  • network_mode (Optional[str]) – Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+. Specify this property to build images on a specific networking mode. Default: - no networking mode specified

  • platform (Optional[str]) – Platform to build for. Requires Docker Buildx. Specify this property to build images on a specific platform. Default: - no platform specified (the current machine architecture will be used)

Return type:

DockerImageAssetLocation

add_file_asset(*, source_hash, deploy_time=None, executable=None, file_name=None, packaging=None)

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.

Parameters:
  • source_hash (str) – A hash on the content source. This hash is used to uniquely identify this asset throughout the system. If this value doesn’t change, the asset will not be rebuilt or republished.

  • deploy_time (Optional[bool]) – Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: false

  • executable (Optional[Sequence[str]]) – An external command that will produce the packaged asset. The command should produce the location of a ZIP file on stdout. Default: - Exactly one of fileName and executable is required

  • file_name (Optional[str]) – The path, relative to the root of the cloud assembly, in which this asset source resides. This can be a path to a file or a directory, depending on the packaging type. Default: - Exactly one of fileName and executable is required

  • packaging (Optional[FileAssetPackaging]) – Which type of packaging to perform. Default: - Required if fileName is specified.

Return type:

FileAssetLocation

bind(stack)

Bind to the stack this environment is going to be used on.

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

Parameters:

stack (Stack) –

Return type:

None

synthesize(session)

Synthesize the associated stack to the session.

Parameters:

session (ISynthesisSession) –

Return type:

None

Attributes

bootstrap_qualifier

The qualifier used to bootstrap this stack.

lookup_role

The role used to lookup for this stack.