Class CliCredentialsStackSynthesizer

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:52.025Z") @Stability(Stable) public class CliCredentialsStackSynthesizer extends StackSynthesizer implements IReusableStackSynthesizer, IBoundStackSynthesizer
A synthesizer that uses conventional asset locations, but not conventional deployment roles.

Instead of assuming the bootstrapped deployment roles, all stack operations will be performed using the CLI's current credentials.

  • This synthesizer does not support deploying to accounts to which the CLI does not have credentials. It also does not support deploying using CDK Pipelines. For either of those features, use DefaultStackSynthesizer.
  • This synthesizer requires an S3 bucket and ECR repository with well-known names. To not depend on those, use LegacyStackSynthesizer.

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.

By default, expects the environment to have been bootstrapped with just the staging resources of the Bootstrap Stack V2 (also known as "modern bootstrap stack"). You can override the default names using the synthesizer's construction properties.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 CliCredentialsStackSynthesizer cliCredentialsStackSynthesizer = CliCredentialsStackSynthesizer.Builder.create()
         .bucketPrefix("bucketPrefix")
         .dockerTagPrefix("dockerTagPrefix")
         .fileAssetsBucketName("fileAssetsBucketName")
         .imageAssetsRepositoryName("imageAssetsRepositoryName")
         .qualifier("qualifier")
         .build();
 
  • Constructor Details

    • CliCredentialsStackSynthesizer

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

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

      @Stability(Stable) public CliCredentialsStackSynthesizer(@Nullable CliCredentialsStackSynthesizerProps props)
      Parameters:
      props -
    • CliCredentialsStackSynthesizer

      @Stability(Stable) public CliCredentialsStackSynthesizer()
  • 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.
    • 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
      Overrides:
      bind in class StackSynthesizer
      Parameters:
      stack - 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.
    • getBootstrapQualifier

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