Class DefaultStackSynthesizer
- All Implemented Interfaces:
IBoundStackSynthesizer
,IReusableStackSynthesizer
,IStackSynthesizer
,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
BootstraplessSynthesizer
This synthesizer:
- Supports cross-account deployments (the CLI can have credentials to one account, and you can still deploy to another account by assuming roles with well-known names in the other account).
- Supports the CDK Pipelines library.
Requires the environment to have been bootstrapped with Bootstrap Stack V2 (also known as "modern bootstrap stack"). The synthesizer adds a version check to the template, to make sure the bootstrap stack is recent enough to support all features expected by this synthesizer.
Example:
App app; Stage prodStage = Stage.Builder.create(app, "ProdStage") .permissionsBoundary(PermissionsBoundary.fromName("cdk-${Qualifier}-PermissionsBoundary-${AWS::AccountId}-${AWS::Region}")) .build(); Stack.Builder.create(prodStage, "ProdStack") .synthesizer(DefaultStackSynthesizer.Builder.create() .qualifier("custom") .build()) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forDefaultStackSynthesizer
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.IBoundStackSynthesizer
IBoundStackSynthesizer.Jsii$Default, IBoundStackSynthesizer.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IReusableStackSynthesizer
IReusableStackSynthesizer.Jsii$Default, IReusableStackSynthesizer.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IStackSynthesizer
IStackSynthesizer.Jsii$Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default bootstrap stack version SSM parameter.static final String
Default CloudFormation role ARN.static final String
Default deploy role ARN.static final String
Default Docker asset prefix.static final String
Name of the CloudFormation Export with the asset key name.static final String
Default file asset prefix.static final String
Default asset publishing role ARN for file (S3) assets.static final String
Default file assets bucket name.static final String
Default asset publishing role ARN for image (ECR) assets.static final String
Default image assets repository name.static final String
Default lookup role ARN for missing values.static final String
Default ARN qualifier. -
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultStackSynthesizer
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DefaultStackSynthesizer
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionRegister a Docker Image Asset.addFileAsset
(FileAssetSource asset) Register a File Asset.void
Bind to the stack this environment is going to be used on.The qualifier used to bootstrap this stack.Returns the ARN of the CFN execution Role.Returns the ARN of the deploy Role.The role used to lookup for this stack.protected Stack
getStack()
Deprecated.reusableBind
(Stack stack) Produce a bound Stack Synthesizer for the given stack.void
synthesize
(ISynthesisSession session) Synthesize the associated stack to the session.protected void
synthesizeStackTemplate
(Stack stack, ISynthesisSession session) Synthesize the stack template to the given session, passing the configured lookup role ARN.Methods inherited from class software.amazon.awscdk.StackSynthesizer
addBootstrapVersionRule, cloudFormationLocationFromDockerImageAsset, cloudFormationLocationFromFileAsset, emitArtifact, emitArtifact, emitStackArtifact, emitStackArtifact, getBoundStack, synthesizeTemplate, synthesizeTemplate, synthesizeTemplate, synthesizeTemplate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
DEFAULT_BOOTSTRAP_STACK_VERSION_SSM_PARAMETER
Default bootstrap stack version SSM parameter. -
DEFAULT_CLOUDFORMATION_ROLE_ARN
Default CloudFormation role ARN. -
DEFAULT_DEPLOY_ROLE_ARN
Default deploy role ARN. -
DEFAULT_DOCKER_ASSET_PREFIX
Default Docker asset prefix. -
DEFAULT_FILE_ASSET_KEY_ARN_EXPORT_NAME
Name of the CloudFormation Export with the asset key name. -
DEFAULT_FILE_ASSET_PREFIX
Default file asset prefix. -
DEFAULT_FILE_ASSET_PUBLISHING_ROLE_ARN
Default asset publishing role ARN for file (S3) assets. -
DEFAULT_FILE_ASSETS_BUCKET_NAME
Default file assets bucket name. -
DEFAULT_IMAGE_ASSET_PUBLISHING_ROLE_ARN
Default asset publishing role ARN for image (ECR) assets. -
DEFAULT_IMAGE_ASSETS_REPOSITORY_NAME
Default image assets repository name. -
DEFAULT_LOOKUP_ROLE_ARN
Default lookup role ARN for missing values. -
DEFAULT_QUALIFIER
Default ARN qualifier.
-
-
Constructor Details
-
DefaultStackSynthesizer
protected DefaultStackSynthesizer(software.amazon.jsii.JsiiObjectRef objRef) -
DefaultStackSynthesizer
protected DefaultStackSynthesizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DefaultStackSynthesizer
- Parameters:
props
-
-
DefaultStackSynthesizer
@Stability(Stable) public DefaultStackSynthesizer()
-
-
Method Details
-
addDockerImageAsset
@Stability(Stable) @NotNull public DockerImageAssetLocation addDockerImageAsset(@NotNull DockerImageAssetSource asset) 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.- Specified by:
addDockerImageAsset
in interfaceIStackSynthesizer
- Specified by:
addDockerImageAsset
in classStackSynthesizer
- Parameters:
asset
- This parameter is required.
-
addFileAsset
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.- Specified by:
addFileAsset
in interfaceIStackSynthesizer
- Specified by:
addFileAsset
in classStackSynthesizer
- Parameters:
asset
- This parameter is required.
-
bind
Bind to the stack this environment is going to be used on.Must be called before any of the other methods are called.
- Specified by:
bind
in interfaceIStackSynthesizer
- Overrides:
bind
in classStackSynthesizer
- Parameters:
stack
- This parameter is required.
-
reusableBind
Produce a bound Stack Synthesizer for the given stack.This method may be called more than once on the same object.
- Specified by:
reusableBind
in interfaceIReusableStackSynthesizer
- Parameters:
stack
- This parameter is required.
-
synthesize
Synthesize the associated stack to the session.- Specified by:
synthesize
in interfaceIStackSynthesizer
- Specified by:
synthesize
in classStackSynthesizer
- Parameters:
session
- This parameter is required.
-
synthesizeStackTemplate
@Stability(Stable) protected void synthesizeStackTemplate(@NotNull Stack stack, @NotNull ISynthesisSession session) Synthesize the stack template to the given session, passing the configured lookup role ARN.- Overrides:
synthesizeStackTemplate
in classStackSynthesizer
- Parameters:
stack
- This parameter is required.session
- This parameter is required.
-
getCloudFormationExecutionRoleArn
Returns the ARN of the CFN execution Role. -
getDeployRoleArn
Returns the ARN of the deploy Role. -
getBootstrapQualifier
The qualifier used to bootstrap this stack.- Specified by:
getBootstrapQualifier
in interfaceIStackSynthesizer
- Overrides:
getBootstrapQualifier
in classStackSynthesizer
-
getLookupRole
The role used to lookup for this stack.- Specified by:
getLookupRole
in interfaceIStackSynthesizer
- Overrides:
getLookupRole
in classStackSynthesizer
-
getStack
Deprecated.UseboundStack
instead.(deprecated) Return the currently bound stack.
-
boundStack
instead.