Class CfnStack
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
AWS::CloudFormation::Stack
resource nests a stack as a resource in a top-level template.
You can add output values from a nested stack within the containing template. You use the GetAtt 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 more information, see CloudFormation stack updates .
You must acknowledge IAM capabilities for nested stacks that contain IAM resources. Also, verify that you have cancel update stack permissions, which is required if an update rolls back. For more information about IAM and CloudFormation , see Controlling access with AWS Identity and Access Management . > A subset of
AWS::CloudFormation::Stack
resource type properties listed below are available to customers using AWS CloudFormation , AWS CDK , and AWS Cloud Control API to configure.
NotificationARNs
Parameters
Tags
TemplateURL
TimeoutInMinutes
These properties can be configured only when using AWS Cloud Control API . This is because the below properties are set by the parent stack, and thus cannot be configured using AWS CloudFormation or AWS CDK but only AWS Cloud Control API .
Capabilities
Description
DisableRollback
EnableTerminationProtection
RoleARN
StackName
StackPolicyBody
StackPolicyURL
StackStatusReason
TemplateBody
Customers that configure
AWS::CloudFormation::Stack
using AWS 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 AWS Cloud Control API .
ChangeSetId
CreationTime
LastUpdateTime
Outputs
ParentId
RootId
StackId
StackStatus
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; CfnStack cfnStack = CfnStack.Builder.create(this, "MyCfnStack") .notificationArns(List.of("notificationArns")) .parameters(Map.of( "parametersKey", "parameters")) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .templateUrl("templateUrl") .timeoutInMinutes(123) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnStack
.static interface
The Output data type.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnStack
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnStack
(software.amazon.jsii.JsiiObjectRef objRef) CfnStack
(software.constructs.Construct scope, String id, CfnStackProps props) -
Method Summary
Modifier and TypeMethodDescriptionReturns the unique ID of the change set.Returns The time at which the stack was created.Returns the time the stack was last updated.Returns a list of output structures.For nested stacks--stacks created as resources for another stack--returns the stack ID of the direct parent of this stack.For nested stacks--stacks created as resources for another stack--returns the stack ID of the top-level stack to which the nested stack ultimately belongs.Returns the unique identifier of the stack.Returns a success or failure message associated with the stack status.The Amazon SNS topic ARNs to publish stack related events.The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.getTags()
Tag Manager which manages the tags for this resource.Key-value pairs to associate with this stack.Location of file containing the template body.The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_COMPLETE
state.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setNotificationArns
(List<String> value) The Amazon SNS topic ARNs to publish stack related events.void
setParameters
(Map<String, String> value) The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.void
setParameters
(IResolvable value) The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.void
setTagsRaw
(List<CfnTag> value) Key-value pairs to associate with this stack.void
setTemplateUrl
(String value) Location of file containing the template body.void
setTimeoutInMinutes
(Number value) The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_COMPLETE
state.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnStack
protected CfnStack(software.amazon.jsii.JsiiObjectRef objRef) -
CfnStack
protected CfnStack(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnStack
@Stability(Stable) public CfnStack(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnStackProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties.
-
CfnStack
@Stability(Stable) public CfnStack(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrChangeSetId
Returns the unique ID of the change set. -
getAttrCreationTime
Returns The time at which the stack was created. -
getAttrLastUpdateTime
Returns the time the stack was last updated.This will only be returned if the stack has been updated at least once.
-
getAttrOutputs
Returns a list of output structures. -
getAttrParentId
For nested stacks--stacks created as resources for another stack--returns the stack ID of the direct parent of this stack.For the first level of nested stacks, the root stack is also the parent stack.
For more information, see Working with Nested Stacks in the AWS CloudFormation User Guide .
-
getAttrRootId
For nested stacks--stacks created as resources for another stack--returns the stack ID of the top-level stack to which the nested stack ultimately belongs.For more information, see Working with Nested Stacks in the AWS CloudFormation User Guide .
-
getAttrStackId
Returns the unique identifier of the stack. -
getAttrStackStatus
Returns a success or failure message associated with the stack status. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getNotificationArns
The Amazon SNS topic ARNs to publish stack related events. -
setNotificationArns
The Amazon SNS topic ARNs to publish stack related events. -
getParameters
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. -
setParameters
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. -
setParameters
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. -
getTagsRaw
Key-value pairs to associate with this stack. -
setTagsRaw
Key-value pairs to associate with this stack. -
getTemplateUrl
Location of file containing the template body. -
setTemplateUrl
Location of file containing the template body. -
getTimeoutInMinutes
The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_COMPLETE
state. -
setTimeoutInMinutes
The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_COMPLETE
state.
-