Class LegacyStackSynthesizer
Use the CDK classic way of referencing assets.
Inherited Members
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LegacyStackSynthesizer : StackSynthesizer, IReusableStackSynthesizer, IBoundStackSynthesizer, IStackSynthesizer
Syntax (vb)
Public Class LegacyStackSynthesizer Inherits StackSynthesizer Implements IReusableStackSynthesizer, IBoundStackSynthesizer, IStackSynthesizer
Remarks
This synthesizer will generate CloudFormation parameters for every referenced asset, and use the CLI's current credentials to deploy the stack.
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().
ExampleMetadata: fixture=_generated
Examples
// 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();
Synopsis
Constructors
| LegacyStackSynthesizer() | Use the CDK classic way of referencing assets. |
Methods
| AddDockerImageAsset(IDockerImageAssetSource) | Register a Docker Image Asset. |
| AddFileAsset(IFileAssetSource) | Register a File Asset. |
| ReusableBind(Stack) | Produce a bound Stack Synthesizer for the given stack. |
| Synthesize(ISynthesisSession) | Synthesize the associated stack to the session. |
Constructors
LegacyStackSynthesizer()
Use the CDK classic way of referencing assets.
public LegacyStackSynthesizer()
Remarks
This synthesizer will generate CloudFormation parameters for every referenced asset, and use the CLI's current credentials to deploy the stack.
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().
ExampleMetadata: fixture=_generated
Examples
// 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();
Methods
AddDockerImageAsset(IDockerImageAssetSource)
Register a Docker Image Asset.
public override IDockerImageAssetLocation AddDockerImageAsset(IDockerImageAssetSource asset)
Parameters
- asset IDockerImageAssetSource
Returns
Overrides
Remarks
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(IFileAssetSource)
Register a File Asset.
public override IFileAssetLocation AddFileAsset(IFileAssetSource asset)
Parameters
- asset IFileAssetSource
Returns
Overrides
Remarks
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.
ReusableBind(Stack)
Produce a bound Stack Synthesizer for the given stack.
public virtual IBoundStackSynthesizer ReusableBind(Stack stack)
Parameters
- stack Stack
Returns
Remarks
This method may be called more than once on the same object.
Synthesize(ISynthesisSession)
Synthesize the associated stack to the session.
public override void Synthesize(ISynthesisSession session)
Parameters
- session ISynthesisSession
Overrides
Remarks
This synthesizer will generate CloudFormation parameters for every referenced asset, and use the CLI's current credentials to deploy the stack.
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().
ExampleMetadata: fixture=_generated