Class CfnStack
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::CloudFormation::Stack
.
The 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 .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.core.*; CfnStack cfnStack = CfnStack.Builder.create(this, "MyCfnStack") .templateUrl("templateUrl") // the properties below are optional .notificationArns(List.of("notificationArns")) .parameters(Map.of( "parametersKey", "parameters")) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .timeoutInMinutes(123) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Simple Notification Service (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()
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 Simple Notification Service (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
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.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
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 Construct scope, @NotNull String id, @NotNull CfnStackProps props) Create a newAWS::CloudFormation::Stack
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Key-value pairs to associate with this stack.AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
-
getTemplateUrl
Location of file containing the template body.The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket. For more information, see Template anatomy .
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
-
setTemplateUrl
Location of file containing the template body.The URL must point to a template (max size: 460,800 bytes) that's located in an Amazon S3 bucket. For more information, see Template anatomy .
Whether an update causes interruptions depends on the resources that are being updated. An update never causes a nested stack to be replaced.
-
getNotificationArns
The Amazon Simple Notification Service (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).
-
setNotificationArns
The Amazon Simple Notification Service (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).
-
getParameters
The 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 typeString
. In other words, you can't pass values that are of typeCommaDelimitedList
to nested stacks.Conditional. 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.
-
setParameters
The 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 typeString
. In other words, you can't pass values that are of typeCommaDelimitedList
to nested stacks.Conditional. 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.
-
setParameters
The 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 typeString
. In other words, you can't pass values that are of typeCommaDelimitedList
to nested stacks.Conditional. 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.
-
getTimeoutInMinutes
The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_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 asCREATE_COMPLETE
in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reachesCREATE_COMPLETE
, CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.Updates aren't supported.
-
setTimeoutInMinutes
The length of time, in minutes, that CloudFormation waits for the nested stack to reach theCREATE_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 asCREATE_COMPLETE
in the parent stack and resumes creating the parent stack. If the timeout period expires before the nested stack reachesCREATE_COMPLETE
, CloudFormation marks the nested stack as failed and rolls back both the nested stack and parent stack.Updates aren't supported.
-