Class LegacyStackSynthesizer

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.StackSynthesizer
software.amazon.awscdk.LegacyStackSynthesizer
All Implemented Interfaces:
IBoundStackSynthesizer, IReusableStackSynthesizer, IStackSynthesizer, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.102.0 (build e354887)", date="2024-08-23T05:56:10.107Z") @Stability(Stable) public class LegacyStackSynthesizer extends StackSynthesizer implements IReusableStackSynthesizer, IBoundStackSynthesizer
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 software.amazon.awscdk.*;
 LegacyStackSynthesizer legacyStackSynthesizer = new LegacyStackSynthesizer();
 
  • Constructor Details

    • LegacyStackSynthesizer

      protected LegacyStackSynthesizer(software.amazon.jsii.JsiiObjectRef objRef)
    • LegacyStackSynthesizer

      protected LegacyStackSynthesizer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • LegacyStackSynthesizer

      @Stability(Stable) public LegacyStackSynthesizer()
  • 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 interface IStackSynthesizer
      Specified by:
      addDockerImageAsset in class StackSynthesizer
      Parameters:
      asset - This parameter is required.
    • addFileAsset

      @Stability(Stable) @NotNull public 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 interface IStackSynthesizer
      Specified by:
      addFileAsset in class StackSynthesizer
      Parameters:
      asset - This parameter is required.
    • reusableBind

      @Stability(Stable) @NotNull public IBoundStackSynthesizer reusableBind(@NotNull Stack stack)
      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 interface IReusableStackSynthesizer
      Parameters:
      stack - This parameter is required.
    • synthesize

      @Stability(Stable) public void synthesize(@NotNull ISynthesisSession session)
      Synthesize the associated stack to the session.

      Specified by:
      synthesize in interface IStackSynthesizer
      Specified by:
      synthesize in class StackSynthesizer
      Parameters:
      session - This parameter is required.