Class StackSynthesizer

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.StackSynthesizer
All Implemented Interfaces:
IStackSynthesizer, software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
AppStagingSynthesizer, CliCredentialsStackSynthesizer, DefaultStackSynthesizer, LegacyStackSynthesizer, NestedStackSynthesizer

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:01.660Z") @Stability(Stable) public abstract class StackSynthesizer extends software.amazon.jsii.JsiiObject implements IStackSynthesizer
Base class for implementing an IStackSynthesizer.

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

  • 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 interface IStackSynthesizer
      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 interface IStackSynthesizer
      Parameters:
      asset - This parameter is required.
    • bind

      @Stability(Stable) public void bind(@NotNull 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.

      Specified by:
      bind in interface IStackSynthesizer
      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

      @Stability(Stable) protected void emitArtifact(@NotNull ISynthesisSession session)
      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.
      Use emitArtifact 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.
      Use emitArtifact 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

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

      Specified by:
      synthesize in interface IStackSynthesizer
      Parameters:
      session - This parameter is required.
    • synthesizeStackTemplate

      @Stability(Deprecated) @Deprecated protected void synthesizeStackTemplate(@NotNull Stack stack, @NotNull ISynthesisSession session)
      Deprecated.
      Use synthesizeTemplate 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)
      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 calling emitArtifact.

      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 calling emitArtifact.

      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

      @Stability(Stable) @NotNull protected Stack getBoundStack()
      Retrieve the bound stack.

      Fails if the stack hasn't been bound yet.

    • getBootstrapQualifier

      @Stability(Stable) @Nullable public String getBootstrapQualifier()
      The qualifier used to bootstrap this stack.
      Specified by:
      getBootstrapQualifier in interface IStackSynthesizer
    • getLookupRole

      @Stability(Stable) @Nullable public String getLookupRole()
      The role used to lookup for this stack.
      Specified by:
      getLookupRole in interface IStackSynthesizer