AWS::CloudFormation::StackThe `AWS::CloudFormation::Stack` resource nests a stack as a resource in a top-level template. For more information, see [Nested stacks](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) in the *CloudFormation User Guide* . You can add output values from a nested stack within the containing template. You use the [GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html) function with the nested stack's logical name and the name of the output value in the nested stack in the format `Outputs. *NestedStackOutputName*` . We strongly recommend that updates to nested stacks are run from the parent stack. When you apply template changes to update a top-level stack, CloudFormation updates the top-level stack and initiates an update to its nested stacks. CloudFormation updates the resources of modified nested stacks, but doesn't update the resources of unmodified nested stacks. For stacks that contain IAM resources, you must acknowledge IAM capabilities. Also, make sure that you have cancel update stack permissions, which are required if an update rolls back. For more information about IAM and CloudFormation , see [Controlling access with AWS Identity and Access Management](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/control-access-with-iam.html) in the *CloudFormation User Guide* . > A subset of `AWS::CloudFormation::Stack` resource type properties listed below are available to customers using CloudFormation , AWS CDK , and Cloud Control to configure. > > - `NotificationARNs` > - `Parameters` > - `Tags` > - `TemplateURL` > - `TimeoutInMinutes` > > These properties can be configured only when using Cloud Control . This is because the below properties are set by the parent stack, and thus cannot be configured using CloudFormation or AWS CDK but only Cloud Control . > > - `Capabilities` > - `Description` > - `DisableRollback` > - `EnableTerminationProtection` > - `RoleARN` > - `StackName` > - `StackPolicyBody` > - `StackPolicyURL` > - `StackStatusReason` > - `TemplateBody` > > Customers that configure `AWS::CloudFormation::Stack` using CloudFormation and AWS CDK can do so for nesting a CloudFormation stack as a resource in their top-level template. > > These read-only properties can be accessed only when using Cloud Control . > > - `ChangeSetId` > - `CreationTime` > - `LastUpdateTime` > - `Outputs` > - `ParentId` > - `RootId` > - `StackId` > - `StackStatus`
import { CfnStack } from 'aws-cdk-lib/aws-cloudformation';Or use the module namespace:
import * as cloudformation from 'aws-cdk-lib/aws-cloudformation';
// cloudformation.CfnStackConfiguration passed to the constructor as CfnStackProps.
notificationArnsOptionalstring[]The Amazon SNS topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
parametersOptional{ [key: string]: string } | IResolvableThe set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. Each parameter has a name corresponding to a parameter defined in the embedded template and a value representing the value that you want to set for the parameter. > If you use the `Ref` function to pass a parameter value to a nested stack, comma-delimited list parameters must be of type `String` . In other words, you can't pass values that are of type `CommaDelimitedList` to nested stacks. Required if the nested stack requires input parameters. Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
tagsOptionalCfnTag[]Key-value pairs to associate with this stack. CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
templateUrlOptionalstringThe URL of a file that contains the template body. The URL must point to a template (max size: 1 MB) that's located in an Amazon S3 bucket. The location for an Amazon S3 bucket must start with `https://` . Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
timeoutInMinutesOptionalnumberThe length of time, in minutes, that CloudFormation waits for the nested stack to reach the `CREATE_COMPLETE` state. The default is no timeout. When CloudFormation detects that the nested stack has reached the `CREATE_COMPLETE` state, it marks the nested stack resource as `CREATE_COMPLETE` in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reaches `CREATE_COMPLETE` , CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack. Updates aren't supported.
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-cloudformationAWS::CloudFormation::Stack