Class StackSynthesizer
- All Implemented Interfaces:
IStackSynthesizer
,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
AppStagingSynthesizer
,CliCredentialsStackSynthesizer
,DefaultStackSynthesizer
,LegacyStackSynthesizer
,NestedStackSynthesizer
This class needs to exist to provide public surface area for external implementations of stack synthesizers. The protected methods give access to functions that are otherwise
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.IStackSynthesizer
IStackSynthesizer.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
StackSynthesizer
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StackSynthesizer
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addBootstrapVersionRule
(Number requiredVersion, String bootstrapStackVersionSsmParameter) Add a CfnRule to the bound stack that checks whether an SSM parameter exceeds a given version.abstract DockerImageAssetLocation
Register a Docker Image Asset.abstract FileAssetLocation
addFileAsset
(FileAssetSource asset) Register a File Asset.void
Bind to the stack this environment is going to be used on.protected DockerImageAssetLocation
Turn a docker asset location into a CloudFormation representation of that location.protected FileAssetLocation
Turn a file asset location into a CloudFormation representation of that location.protected void
emitArtifact
(ISynthesisSession session) Write the CloudFormation stack artifact to the session.protected void
emitArtifact
(ISynthesisSession session, SynthesizeStackArtifactOptions options) Write the CloudFormation stack artifact to the session.protected void
emitStackArtifact
(Stack stack, ISynthesisSession session) Deprecated.protected void
emitStackArtifact
(Stack stack, ISynthesisSession session, SynthesizeStackArtifactOptions options) Deprecated.UseemitArtifact
insteadThe qualifier used to bootstrap this stack.protected Stack
Retrieve the bound stack.The role used to lookup for this stack.abstract void
synthesize
(ISynthesisSession session) Synthesize the associated stack to the session.protected void
synthesizeStackTemplate
(Stack stack, ISynthesisSession session) Deprecated.UsesynthesizeTemplate
insteadprotected FileAssetSource
synthesizeTemplate
(ISynthesisSession session) Write the stack template to the given session.protected FileAssetSource
synthesizeTemplate
(ISynthesisSession session, String lookupRoleArn) Write the stack template to the given session.protected FileAssetSource
synthesizeTemplate
(ISynthesisSession session, String lookupRoleArn, String lookupRoleExternalId) Write the stack template to the given session.protected FileAssetSource
synthesizeTemplate
(ISynthesisSession session, String lookupRoleArn, String lookupRoleExternalId, Map<String, Object> lookupRoleAdditionalOptions) Write the stack template to the given session.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
-
Constructor Details
-
StackSynthesizer
protected StackSynthesizer(software.amazon.jsii.JsiiObjectRef objRef) -
StackSynthesizer
protected StackSynthesizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StackSynthesizer
@Stability(Stable) protected StackSynthesizer()
-
-
Method Details
-
addBootstrapVersionRule
@Stability(Stable) protected void addBootstrapVersionRule(@NotNull Number requiredVersion, @NotNull String bootstrapStackVersionSsmParameter) Add a CfnRule to the bound stack that checks whether an SSM parameter exceeds a given version.This will modify the template, so must be called before the stack is synthesized.
- Parameters:
requiredVersion
- This parameter is required.bootstrapStackVersionSsmParameter
- This parameter is required.
-
addDockerImageAsset
@Stability(Stable) @NotNull public abstract 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
- Parameters:
asset
- This parameter is required.
-
addFileAsset
@Stability(Stable) @NotNull public abstract FileAssetLocation addFileAsset(@NotNull FileAssetSource asset) 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
- 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
- Parameters:
stack
- This parameter is required.
-
cloudFormationLocationFromDockerImageAsset
@Stability(Stable) @NotNull protected DockerImageAssetLocation cloudFormationLocationFromDockerImageAsset(@NotNull DockerImageDestination dest) Turn a docker asset location into a CloudFormation representation of that location.If any of the fields contain placeholders, the result will be wrapped in a
Fn.sub
.- Parameters:
dest
- This parameter is required.
-
cloudFormationLocationFromFileAsset
@Stability(Stable) @NotNull protected FileAssetLocation cloudFormationLocationFromFileAsset(@NotNull FileDestination location) Turn a file asset location into a CloudFormation representation of that location.If any of the fields contain placeholders, the result will be wrapped in a
Fn.sub
.- Parameters:
location
- This parameter is required.
-
emitArtifact
@Stability(Stable) protected void emitArtifact(@NotNull ISynthesisSession session, @Nullable SynthesizeStackArtifactOptions options) Write the CloudFormation stack artifact to the session.Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session. The Stack artifact will control the settings for the CloudFormation deployment.
- Parameters:
session
- This parameter is required.options
-
-
emitArtifact
Write the CloudFormation stack artifact to the session.Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session. The Stack artifact will control the settings for the CloudFormation deployment.
- Parameters:
session
- This parameter is required.
-
emitStackArtifact
@Stability(Deprecated) @Deprecated protected void emitStackArtifact(@NotNull Stack stack, @NotNull ISynthesisSession session, @Nullable SynthesizeStackArtifactOptions options) Deprecated.UseemitArtifact
instead(deprecated) Write the stack artifact to the session.Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session.
- Parameters:
stack
- This parameter is required.session
- This parameter is required.options
-
-
emitStackArtifact
@Stability(Deprecated) @Deprecated protected void emitStackArtifact(@NotNull Stack stack, @NotNull ISynthesisSession session) Deprecated.UseemitArtifact
instead(deprecated) Write the stack artifact to the session.Use default settings to add a CloudFormationStackArtifact artifact to the given synthesis session.
- Parameters:
stack
- This parameter is required.session
- This parameter is required.
-
synthesize
Synthesize the associated stack to the session.- Specified by:
synthesize
in interfaceIStackSynthesizer
- Parameters:
session
- This parameter is required.
-
synthesizeStackTemplate
@Stability(Deprecated) @Deprecated protected void synthesizeStackTemplate(@NotNull Stack stack, @NotNull ISynthesisSession session) Deprecated.UsesynthesizeTemplate
instead(deprecated) Have the stack write out its template.- Parameters:
stack
- This parameter is required.session
- This parameter is required.
-
synthesizeTemplate
@Stability(Stable) @NotNull protected FileAssetSource synthesizeTemplate(@NotNull ISynthesisSession session, @Nullable String lookupRoleArn, @Nullable String lookupRoleExternalId, @Nullable Map<String, Object> lookupRoleAdditionalOptions) Write the stack template to the given session.Return a descriptor that represents the stack template as a file asset source, for adding to an asset manifest (if desired). This can be used to have the asset manifest system (
cdk-assets
) upload the template to S3 using the appropriate role, so that afterwards only a CloudFormation deployment is necessary.If the template is uploaded as an asset, the
stackTemplateAssetObjectUrl
property should be set when callingemitArtifact.
If the template is NOT uploaded as an asset first and the template turns out to be >50KB, it will need to be uploaded to S3 anyway. At that point the credentials will be the same identity that is doing the
UpdateStack
call, which may not have the right permissions to write to S3.- Parameters:
session
- This parameter is required.lookupRoleArn
-lookupRoleExternalId
-lookupRoleAdditionalOptions
-
-
synthesizeTemplate
@Stability(Stable) @NotNull protected FileAssetSource synthesizeTemplate(@NotNull ISynthesisSession session, @Nullable String lookupRoleArn, @Nullable String lookupRoleExternalId) Write the stack template to the given session.Return a descriptor that represents the stack template as a file asset source, for adding to an asset manifest (if desired). This can be used to have the asset manifest system (
cdk-assets
) upload the template to S3 using the appropriate role, so that afterwards only a CloudFormation deployment is necessary.If the template is uploaded as an asset, the
stackTemplateAssetObjectUrl
property should be set when callingemitArtifact.
If the template is NOT uploaded as an asset first and the template turns out to be >50KB, it will need to be uploaded to S3 anyway. At that point the credentials will be the same identity that is doing the
UpdateStack
call, which may not have the right permissions to write to S3.- Parameters:
session
- This parameter is required.lookupRoleArn
-lookupRoleExternalId
-
-
synthesizeTemplate
@Stability(Stable) @NotNull protected FileAssetSource synthesizeTemplate(@NotNull ISynthesisSession session, @Nullable String lookupRoleArn) Write the stack template to the given session.Return a descriptor that represents the stack template as a file asset source, for adding to an asset manifest (if desired). This can be used to have the asset manifest system (
cdk-assets
) upload the template to S3 using the appropriate role, so that afterwards only a CloudFormation deployment is necessary.If the template is uploaded as an asset, the
stackTemplateAssetObjectUrl
property should be set when callingemitArtifact.
If the template is NOT uploaded as an asset first and the template turns out to be >50KB, it will need to be uploaded to S3 anyway. At that point the credentials will be the same identity that is doing the
UpdateStack
call, which may not have the right permissions to write to S3.- Parameters:
session
- This parameter is required.lookupRoleArn
-
-
synthesizeTemplate
@Stability(Stable) @NotNull protected FileAssetSource synthesizeTemplate(@NotNull ISynthesisSession session) Write the stack template to the given session.Return a descriptor that represents the stack template as a file asset source, for adding to an asset manifest (if desired). This can be used to have the asset manifest system (
cdk-assets
) upload the template to S3 using the appropriate role, so that afterwards only a CloudFormation deployment is necessary.If the template is uploaded as an asset, the
stackTemplateAssetObjectUrl
property should be set when callingemitArtifact.
If the template is NOT uploaded as an asset first and the template turns out to be >50KB, it will need to be uploaded to S3 anyway. At that point the credentials will be the same identity that is doing the
UpdateStack
call, which may not have the right permissions to write to S3.- Parameters:
session
- This parameter is required.
-
getBoundStack
Retrieve the bound stack.Fails if the stack hasn't been bound yet.
-
getBootstrapQualifier
The qualifier used to bootstrap this stack.- Specified by:
getBootstrapQualifier
in interfaceIStackSynthesizer
-
getLookupRole
The role used to lookup for this stack.- Specified by:
getLookupRole
in interfaceIStackSynthesizer
-
emitArtifact
instead