BootstraplessSynthesizer

class aws_cdk.core.BootstraplessSynthesizer(*, cloud_formation_execution_role_arn=None, deploy_role_arn=None)

Bases: DefaultStackSynthesizer

Synthesizer that reuses bootstrap roles from a different region.

A special synthesizer that behaves similarly to DefaultStackSynthesizer, but doesn’t require bootstrapping the environment it operates in. Instead, it will re-use the Roles that were created for a different region (which is possible because IAM is a global service).

However, it will not assume asset buckets or repositories have been created, and therefore does not support assets.

Used by the CodePipeline construct for the support stacks needed for cross-region replication S3 buckets. App builders do not need to use this synthesizer 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.core as cdk

bootstrapless_synthesizer = cdk.BootstraplessSynthesizer(
    cloud_formation_execution_role_arn="cloudFormationExecutionRoleArn",
    deploy_role_arn="deployRoleArn"
)
Parameters:
  • cloud_formation_execution_role_arn (Optional[str]) – The CFN execution Role ARN to use. Default: - No CloudFormation role (use CLI credentials)

  • deploy_role_arn (Optional[str]) – The deploy Role ARN to use. Default: - No deploy role (use CLI credentials)

Methods

add_docker_image_asset(*, source_hash, directory_name=None, docker_build_args=None, docker_build_target=None, docker_file=None, executable=None, network_mode=None, platform=None, repository_name=None)

Register a Docker Image Asset.

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

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

  • 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_target (Optional[str]) – Docker target to build to. Only allowed when directoryName is specified. Default: - no target

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

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

  • repository_name (Optional[str]) – (deprecated) ECR repository name. Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts. Default: - automatically derived from the asset’s ID.

Return type:

DockerImageAssetLocation

add_file_asset(*, source_hash, 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.

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.

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

DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER = '/cdk-bootstrap/${Qualifier}/version'
DEFAULT_CLOUDFORMATION_ROLE_ARN = 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-cfn-exec-role-${AWS::AccountId}-${AWS::Region}'
DEFAULT_DEPLOY_ROLE_ARN = 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-deploy-role-${AWS::AccountId}-${AWS::Region}'
DEFAULT_DOCKER_ASSET_PREFIX = ''
DEFAULT_FILE_ASSETS_BUCKET_NAME = 'cdk-${Qualifier}-assets-${AWS::AccountId}-${AWS::Region}'
DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME = 'CdkBootstrap-${Qualifier}-FileAssetKeyArn'
DEFAULT_FILE_ASSET_PREFIX = ''
DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN = 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-file-publishing-role-${AWS::AccountId}-${AWS::Region}'
DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME = 'cdk-${Qualifier}-container-assets-${AWS::AccountId}-${AWS::Region}'
DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN = 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-image-publishing-role-${AWS::AccountId}-${AWS::Region}'
DEFAULT_LOOKUP_ROLE_ARN = 'arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-lookup-role-${AWS::AccountId}-${AWS::Region}'
DEFAULT_QUALIFIER = 'hnb659fds'
cloud_formation_execution_role_arn

Returns the ARN of the CFN execution Role.

deploy_role_arn

Returns the ARN of the deploy Role.