Skip to content
v2.278.0

AwsCloudFormationStackProperties Struct ​

Artifact properties for CloudFormation stacks.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';

declare const assumeRoleAdditionalOptions: any;
const awsCloudFormationStackProperties: cloud_assembly_schema.AwsCloudFormationStackProperties = {
  templateFile: 'templateFile',

  // the properties below are optional
  assumeRoleAdditionalOptions: {
    assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
  },
  assumeRoleArn: 'assumeRoleArn',
  assumeRoleExternalId: 'assumeRoleExternalId',
  bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
  cloudFormationExecutionRoleArn: 'cloudFormationExecutionRoleArn',
  lookupRole: {
    arn: 'arn',

    // the properties below are optional
    assumeRoleAdditionalOptions: {
      assumeRoleAdditionalOptionsKey: assumeRoleAdditionalOptions,
    },
    assumeRoleExternalId: 'assumeRoleExternalId',
    bootstrapStackVersionSsmParameter: 'bootstrapStackVersionSsmParameter',
    requiresBootstrapStackVersion: 123,
  },
  notificationArns: ['notificationArns'],
  parameters: {
    parametersKey: 'parameters',
  },
  requiresBootstrapStackVersion: 123,
  stackName: 'stackName',
  stackTemplateAssetObjectUrl: 'stackTemplateAssetObjectUrl',
  tags: {
    tagsKey: 'tags',
  },
  terminationProtection: false,
  validateOnSynth: false,
};
python
from aws_cdk.cloud_assembly_schema import AwsCloudFormationStackProperties, BootstrapRole
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema

# assume_role_additional_options: Any

aws_cloud_formation_stack_properties = AwsCloudFormationStackProperties(
    template_file="templateFile",

    # the properties below are optional
    assume_role_additional_options={
        "assume_role_additional_options_key": assume_role_additional_options
    },
    assume_role_arn="assumeRoleArn",
    assume_role_external_id="assumeRoleExternalId",
    bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter",
    cloud_formation_execution_role_arn="cloudFormationExecutionRoleArn",
    lookup_role=BootstrapRole(
        arn="arn",

        # the properties below are optional
        assume_role_additional_options={
            "assume_role_additional_options_key": assume_role_additional_options
        },
        assume_role_external_id="assumeRoleExternalId",
        bootstrap_stack_version_ssm_parameter="bootstrapStackVersionSsmParameter",
        requires_bootstrap_stack_version=123
    ),
    notification_arns=["notificationArns"],
    parameters={
        "parameters_key": "parameters"
    },
    requires_bootstrap_stack_version=123,
    stack_name="stackName",
    stack_template_asset_object_url="stackTemplateAssetObjectUrl",
    tags={
        "tags_key": "tags"
    },
    termination_protection=False,
    validate_on_synth=False
)
java
// 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.*;

Object assumeRoleAdditionalOptions;

AwsCloudFormationStackProperties awsCloudFormationStackProperties = 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();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;

var assumeRoleAdditionalOptions;

var awsCloudFormationStackProperties = new AwsCloudFormationStackProperties {
    TemplateFile = "templateFile",

    // the properties below are optional
    AssumeRoleAdditionalOptions = new Dictionary<string, object> {
        { "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions }
    },
    AssumeRoleArn = "assumeRoleArn",
    AssumeRoleExternalId = "assumeRoleExternalId",
    BootstrapStackVersionSsmParameter = "bootstrapStackVersionSsmParameter",
    CloudFormationExecutionRoleArn = "cloudFormationExecutionRoleArn",
    LookupRole = new BootstrapRole {
        Arn = "arn",

        // the properties below are optional
        AssumeRoleAdditionalOptions = new Dictionary<string, object> {
            { "assumeRoleAdditionalOptionsKey", assumeRoleAdditionalOptions }
        },
        AssumeRoleExternalId = "assumeRoleExternalId",
        BootstrapStackVersionSsmParameter = "bootstrapStackVersionSsmParameter",
        RequiresBootstrapStackVersion = 123
    },
    NotificationArns = new [] { "notificationArns" },
    Parameters = new Dictionary<string, string> {
        { "parametersKey", "parameters" }
    },
    RequiresBootstrapStackVersion = 123,
    StackName = "stackName",
    StackTemplateAssetObjectUrl = "stackTemplateAssetObjectUrl",
    Tags = new Dictionary<string, string> {
        { "tagsKey", "tags" }
    },
    TerminationProtection = false,
    ValidateOnSynth = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var assumeRoleAdditionalOptions interface{}

awsCloudFormationStackProperties := &AwsCloudFormationStackProperties{
	TemplateFile: jsii.String("templateFile"),

	// the properties below are optional
	AssumeRoleAdditionalOptions: map[string]interface{}{
		"assumeRoleAdditionalOptionsKey": assumeRoleAdditionalOptions,
	},
	AssumeRoleArn: jsii.String("assumeRoleArn"),
	AssumeRoleExternalId: jsii.String("assumeRoleExternalId"),
	BootstrapStackVersionSsmParameter: jsii.String("bootstrapStackVersionSsmParameter"),
	CloudFormationExecutionRoleArn: jsii.String("cloudFormationExecutionRoleArn"),
	LookupRole: &BootstrapRole{
		Arn: jsii.String("arn"),

		// the properties below are optional
		AssumeRoleAdditionalOptions: map[string]interface{}{
			"assumeRoleAdditionalOptionsKey": assumeRoleAdditionalOptions,
		},
		AssumeRoleExternalId: jsii.String("assumeRoleExternalId"),
		BootstrapStackVersionSsmParameter: jsii.String("bootstrapStackVersionSsmParameter"),
		RequiresBootstrapStackVersion: jsii.Number(123),
	},
	NotificationArns: []*string{
		jsii.String("notificationArns"),
	},
	Parameters: map[string]*string{
		"parametersKey": jsii.String("parameters"),
	},
	RequiresBootstrapStackVersion: jsii.Number(123),
	StackName: jsii.String("stackName"),
	StackTemplateAssetObjectUrl: jsii.String("stackTemplateAssetObjectUrl"),
	Tags: map[string]*string{
		"tagsKey": jsii.String("tags"),
	},
	TerminationProtection: jsii.Boolean(false),
	ValidateOnSynth: jsii.Boolean(false),
}

Properties ​

assumeRoleAdditionalOptionsoptional{ [key: string]: any }assume_role_additional_optionsoptionaltyping.Mapping[str, Any]assumeRoleAdditionalOptionsoptionalMap<String, Object>AssumeRoleAdditionalOptionsoptionalIDictionary<string, object>AssumeRoleAdditionalOptionsoptional*map[string]interface{} #
Additional options to pass to STS when assuming the role.

Default: No additional options.

  • RoleArn should not be used. Use the dedicated assumeRoleArn property instead.
  • ExternalId should not be used. Use the dedicated assumeRoleExternalId instead.
assumeRoleArnoptionalstringassume_role_arnoptionalstrassumeRoleArnoptionalStringAssumeRoleArnoptionalstringAssumeRoleArnoptional*string #
The role that needs to be assumed to deploy the stack.

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

assumeRoleExternalIdoptionalstringassume_role_external_idoptionalstrassumeRoleExternalIdoptionalStringAssumeRoleExternalIdoptionalstringAssumeRoleExternalIdoptional*string #
External ID to use when assuming role for cloudformation deployments.

Default: No external ID

bootstrapStackVersionSsmParameteroptionalstringbootstrap_stack_version_ssm_parameteroptionalstrbootstrapStackVersionSsmParameteroptionalStringBootstrapStackVersionSsmParameteroptionalstringBootstrapStackVersionSsmParameteroptional*string #
SSM parameter where the bootstrap stack version number can be found.

Default: Bootstrap stack version number looked up

notes

Only used if requiresBootstrapStackVersion is set.

  • If this value is not set, the bootstrap stack name must be known at deployment time so the stack version can be looked up from the stack outputs.
  • If this value is set, the bootstrap stack can have any name because we won't need to look it up.
cloudFormationExecutionRoleArnoptionalstringcloud_formation_execution_role_arnoptionalstrcloudFormationExecutionRoleArnoptionalStringCloudFormationExecutionRoleArnoptionalstringCloudFormationExecutionRoleArnoptional*string #
The role that is passed to CloudFormation to execute the change set.

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

lookupRoleoptionalBootstrapRolelookup_roleoptionalBootstrapRolelookupRoleoptionalBootstrapRoleLookupRoleoptionalBootstrapRoleLookupRoleoptionalBootstrapRole #
The role to use to look up values from the target AWS account.

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

notificationArnsoptionalstring[]notification_arnsoptionaltyping.List[str]notificationArnsoptionalList<String>NotificationArnsoptionalstring[]NotificationArnsoptional*[]*string #
SNS Notification ARNs that should receive CloudFormation Stack Events.

Default: No notification arns

parametersoptional{ [key: string]: string }parametersoptionaltyping.Mapping[str, str]parametersoptionalMap<String, String>ParametersoptionalIDictionary<string, string>Parametersoptional*map[string]*string #
Values for CloudFormation stack parameters that should be passed when the stack is deployed.

Default: No parameters

requiresBootstrapStackVersionoptionalnumberrequires_bootstrap_stack_versionoptionalint | floatrequiresBootstrapStackVersionoptionalNumberRequiresBootstrapStackVersionoptionaldoubleRequiresBootstrapStackVersionoptional*float64 #
Version of bootstrap stack required to deploy this stack.

Default: No bootstrap stack required

stackNameoptionalstringstack_nameoptionalstrstackNameoptionalStringStackNameoptionalstringStackNameoptional*string #
The name to use for the CloudFormation stack.

Default: name derived from artifact ID

stackTemplateAssetObjectUrloptionalstringstack_template_asset_object_urloptionalstrstackTemplateAssetObjectUrloptionalStringStackTemplateAssetObjectUrloptionalstringStackTemplateAssetObjectUrloptional*string #
If the stack template has already been included in the asset manifest, its asset URL.

Default: Not uploaded yet, upload just before deploying

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #
Values for CloudFormation stack tags that should be passed when the stack is deployed.

Default: No tags

notes

N.B.: Tags are also written to stack metadata, under the path of the Stack construct. Only in CDK CLI v1 are those tags found in metadata used for actual deployments; in all stable versions of CDK only the stack tags directly found in the tags property of AwsCloudFormationStack artifact (i.e., this property) are used.

templateFilestringtemplate_filestrtemplateFileStringTemplateFilestringTemplateFile*string required #
A file relative to the assembly root which contains the CloudFormation template for this stack.
terminationProtectionoptionalbooleantermination_protectionoptionalboolterminationProtectionoptionalBooleanTerminationProtectionoptionalboolTerminationProtectionoptional*bool = false #
Whether to enable termination protection for this stack.
validateOnSynthoptionalbooleanvalidate_on_synthoptionalboolvalidateOnSynthoptionalBooleanValidateOnSynthoptionalboolValidateOnSynthoptional*bool = false #
Whether this stack should be validated by the CLI after synthesis.