LegacyStackSynthesizer Class
Use the CDK classic way of referencing assets.
This synthesizer will generate CloudFormation parameters for every referenced asset, and use the CLI's current credentials to deploy the stack.
- It does not support cross-account deployment (the CLI must have credentials to the account you are trying to deploy to).
- It cannot be used with CDK Pipelines. To deploy using CDK Pipelines, you must use the
DefaultStackSynthesizer. - Each asset will take up a CloudFormation Parameter in your template. Keep in mind that there is a maximum of 200 parameters in a CloudFormation template. To use deterministic asset locations instead, use
CliCredentialsStackSynthesizer.
Be aware that your CLI credentials must be valid for the duration of the entire deployment. If you are using session credentials, make sure the session lifetime is long enough.
This is the only StackSynthesizer that supports customizing asset behavior by overriding Stack.addFileAsset() and Stack.addDockerImageAsset().
Example
// 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';
const legacyStackSynthesizer = new cdk.LegacyStackSynthesizer();
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
legacy_stack_synthesizer = cdk.LegacyStackSynthesizer()
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
LegacyStackSynthesizer legacyStackSynthesizer = new LegacyStackSynthesizer();
// 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;
var legacyStackSynthesizer = new LegacyStackSynthesizer();
// 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"
legacyStackSynthesizer := cdk.NewLegacyStackSynthesizer()
Initializer
new LegacyStackSynthesizer()
LegacyStackSynthesizer()
new LegacyStackSynthesizer()
new LegacyStackSynthesizer()
NewLegacyStackSynthesizer()
Properties
bootstrapQualifierstringbootstrap_qualifierstrbootstrapQualifierStringBootstrapQualifierstringBootstrapQualifier*string#cloudFormationExecutionRolestringcloud_formation_execution_rolestrcloudFormationExecutionRoleStringCloudFormationExecutionRolestringCloudFormationExecutionRole*string#Methods
addDockerImageAsset(asset: DockerImageAssetSource): DockerImageAssetLocationdef add_docker_image_asset(self, asset: DockerImageAssetSource) -> DockerImageAssetLocationpublic DockerImageAssetLocation addDockerImageAsset(DockerImageAssetSource asset)public DockerImageAssetLocation AddDockerImageAsset(DockerImageAssetSource asset)func AddDockerImageAsset(Asset DockerImageAssetSource) DockerImageAssetLocation#notes
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): FileAssetLocationdef add_file_asset(self, asset: FileAssetSource) -> FileAssetLocationpublic FileAssetLocation addFileAsset(FileAssetSource asset)public FileAssetLocation AddFileAsset(FileAssetSource asset)func AddFileAsset(Asset FileAssetSource) FileAssetLocation#notes
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): voiddef bind(self, stack: Stack) -> Nonepublic void bind(Stack stack)public void Bind(Stack stack)func Bind(Stack Stack)#Must be called before any of the other methods are called.
reusableBind(stack: Stack): IBoundStackSynthesizerdef reusable_bind(self, stack: Stack) -> IBoundStackSynthesizerpublic IBoundStackSynthesizer reusableBind(Stack stack)public IBoundStackSynthesizer ReusableBind(Stack stack)func ReusableBind(Stack Stack) IBoundStackSynthesizer#This method may be called more than once on the same object.
synthesize(session: ISynthesisSession): voiddef synthesize(self, session: ISynthesisSession) -> Nonepublic void synthesize(ISynthesisSession session)public void Synthesize(ISynthesisSession session)func Synthesize(Session ISynthesisSession)#