class LegacyStackSynthesizer
Language | Type name |
---|---|
.NET | Amazon.CDK.LegacyStackSynthesizer |
Java | software.amazon.awscdk.core.LegacyStackSynthesizer |
Python | aws_cdk.core.LegacyStackSynthesizer |
TypeScript (source) | @aws-cdk/core » LegacyStackSynthesizer |
Implements
IStack
Extends
Stack
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 determinstic 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/core';
const legacyStackSynthesizer = new cdk.LegacyStackSynthesizer();
Initializer
new LegacyStackSynthesizer()
Methods
Name | Description |
---|---|
add | Register a Docker Image Asset. |
add | Register a File Asset. |
bind(stack) | Bind to the stack this environment is going to be used on. |
synthesize(session) | Synthesize the associated stack to the session. |
DockerImageAsset(asset)
addpublic addDockerImageAsset(asset: DockerImageAssetSource): DockerImageAssetLocation
Parameters
- asset
Docker
Image Asset Source
Returns
Register a Docker Image Asset.
Returns the parameters that can be used to refer to the asset inside the template.
FileAsset(asset)
addpublic addFileAsset(asset: FileAssetSource): FileAssetLocation
Parameters
- asset
File
Asset Source
Returns
Register a File Asset.
Returns the parameters that can be used to refer to the asset inside the template.
bind(stack)
public bind(stack: Stack): void
Parameters
- stack
Stack
Bind to the stack this environment is going to be used on.
Must be called before any of the other methods are called.
synthesize(session)
public synthesize(session: ISynthesisSession): void
Parameters
- session
ISynthesis
Session
Synthesize the associated stack to the session.