Class CloudFormationStackArtifact

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.cxapi.CloudArtifact
software.amazon.awscdk.cxapi.CloudFormationStackArtifact
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:18.446Z") @Stability(Stable) public class CloudFormationStackArtifact extends CloudArtifact
Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cloud_assembly_schema.*;
 import software.amazon.awscdk.cxapi.*;
 Object assumeRoleAdditionalOptions;
 CloudAssembly cloudAssembly;
 CloudFormationStackArtifact cloudFormationStackArtifact = CloudFormationStackArtifact.Builder.create(cloudAssembly, "artifactId")
         .type(ArtifactType.NONE)
         // the properties below are optional
         .dependencies(List.of("dependencies"))
         .displayName("displayName")
         .environment("environment")
         .metadata(Map.of(
                 "metadataKey", List.of(MetadataEntry.builder()
                         .type("type")
                         // the properties below are optional
                         .data("data")
                         .trace(List.of("trace"))
                         .build())))
         .properties(AwsCloudFormationStackProperties.builder()
                 .templateFile("templateFile")
                 // the properties below are optional
                 .assumeRoleAdditionalOptions(Map.of(
                         "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions))
                 .assumeRoleArn("assumeRoleArn")
                 .assumeRoleExternalId("assumeRoleExternalId")
                 .bootstrapStackVersionSsmParameter("bootstrapStackVersionSsmParameter")
                 .cloudFormationExecutionRoleArn("cloudFormationExecutionRoleArn")
                 .lookupRole(BootstrapRole.builder()
                         .arn("arn")
                         // the properties below are optional
                         .assumeRoleAdditionalOptions(Map.of(
                                 "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions))
                         .assumeRoleExternalId("assumeRoleExternalId")
                         .bootstrapStackVersionSsmParameter("bootstrapStackVersionSsmParameter")
                         .requiresBootstrapStackVersion(123)
                         .build())
                 .notificationArns(List.of("notificationArns"))
                 .parameters(Map.of(
                         "parametersKey", "parameters"))
                 .requiresBootstrapStackVersion(123)
                 .stackName("stackName")
                 .stackTemplateAssetObjectUrl("stackTemplateAssetObjectUrl")
                 .tags(Map.of(
                         "tagsKey", "tags"))
                 .terminationProtection(false)
                 .validateOnSynth(false)
                 .build())
         .build();
 
  • Constructor Details

    • CloudFormationStackArtifact

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

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

      @Stability(Stable) public CloudFormationStackArtifact(@NotNull CloudAssembly assembly, @NotNull String artifactId, @NotNull ArtifactManifest artifact)
      Parameters:
      assembly - This parameter is required.
      artifactId - This parameter is required.
      artifact - This parameter is required.
  • Method Details

    • isCloudFormationStackArtifact

      @Stability(Stable) @NotNull public static Boolean isCloudFormationStackArtifact(@NotNull Object art)
      Checks if art is an instance of this class.

      Use this method instead of instanceof to properly detect CloudFormationStackArtifact instances, even when the construct library is symlinked.

      Explanation: in JavaScript, multiple copies of the cx-api library on disk are seen as independent, completely different libraries. As a consequence, the class CloudFormationStackArtifact in each copy of the cx-api library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the cx-api library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

      Parameters:
      art - This parameter is required.
    • getAssets

      @Stability(Stable) @NotNull public List<Object> getAssets()
      Any assets associated with this stack.
    • getDisplayName

      @Stability(Stable) @NotNull public String getDisplayName()
      A string that represents this stack.

      Should only be used in user interfaces. If the stackName has not been set explicitly, or has been set to artifactId, it will return the hierarchicalId of the stack. Otherwise, it will return something like " ()"

    • getEnvironment

      @Stability(Stable) @NotNull public Environment getEnvironment()
      The environment into which to deploy this artifact.
    • getNotificationArns

      @Stability(Stable) @NotNull public List<String> getNotificationArns()
      SNS Topics that will receive stack events.
    • getOriginalName

      @Stability(Stable) @NotNull public String getOriginalName()
      The original name as defined in the CDK app.
    • getParameters

      @Stability(Stable) @NotNull public Map<String,String> getParameters()
      CloudFormation parameters to pass to the stack.
    • getStackName

      @Stability(Stable) @NotNull public String getStackName()
      The physical name of this stack.
    • getTags

      @Stability(Stable) @NotNull public Map<String,String> getTags()
      CloudFormation tags to pass to the stack.
    • getTemplate

      @Stability(Stable) @NotNull public Object getTemplate()
      The CloudFormation template for this stack.
    • getTemplateFile

      @Stability(Stable) @NotNull public String getTemplateFile()
      The file name of the template.
    • getTemplateFullPath

      @Stability(Stable) @NotNull public String getTemplateFullPath()
      Full path to the template file.
    • getAssumeRoleAdditionalOptions

      @Stability(Stable) @Nullable public Map<String,Object> getAssumeRoleAdditionalOptions()
      Additional options to pass to STS when assuming the role for cloudformation deployments.

      • RoleArn should not be used. Use the dedicated assumeRoleArn property instead.
      • ExternalId should not be used. Use the dedicated assumeRoleExternalId instead.
      • TransitiveTagKeys defaults to use all keys (if any) specified in Tags. E.g, all tags are transitive by default.

      Default: - No additional options.

      See Also:
    • getAssumeRoleArn

      @Stability(Stable) @Nullable public String getAssumeRoleArn()
      The role that needs to be assumed to deploy the stack.

      Default: - No role is assumed (current credentials are used)

    • getAssumeRoleExternalId

      @Stability(Stable) @Nullable public String getAssumeRoleExternalId()
      External ID to use when assuming role for cloudformation deployments.

      Default: - No external ID

    • getBootstrapStackVersionSsmParameter

      @Stability(Stable) @Nullable public String getBootstrapStackVersionSsmParameter()
      Name of SSM parameter with bootstrap stack version.

      Default: - Discover SSM parameter by reading stack

    • getCloudFormationExecutionRoleArn

      @Stability(Stable) @Nullable public String getCloudFormationExecutionRoleArn()
      The role that is passed to CloudFormation to execute the change set.

      Default: - No role is passed (currently assumed role/credentials are used)

    • getLookupRole

      @Stability(Stable) @Nullable public BootstrapRole getLookupRole()
      The role to use to look up values from the target AWS account.

      Default: - No role is assumed (current credentials are used)

    • getRequiresBootstrapStackVersion

      @Stability(Stable) @Nullable public Number getRequiresBootstrapStackVersion()
      Version of bootstrap stack required to deploy this stack.

      Default: - No bootstrap stack required

    • getStackTemplateAssetObjectUrl

      @Stability(Stable) @Nullable public String getStackTemplateAssetObjectUrl()
      If the stack template has already been included in the asset manifest, its asset URL.

      Default: - Not uploaded yet, upload just before deploying

    • getTerminationProtection

      @Stability(Stable) @Nullable public Boolean getTerminationProtection()
      Whether termination protection is enabled for this stack.
    • getValidateOnSynth

      @Stability(Stable) @Nullable public Boolean getValidateOnSynth()
      Whether this stack should be validated by the CLI after synthesis.

      Default: - false