@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-14T16:25:30.456Z") public class CfnStack extends CfnResource implements IInspectable
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.services.cloudformation.*; 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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnStack.Builder
A fluent builder for
CfnStack . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnStack(Construct scope,
java.lang.String id,
CfnStackProps props)
Create a new `AWS::CloudFormation::Stack`.
|
protected |
CfnStack(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnStack(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.util.List<java.lang.String> |
getNotificationArns()
The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events.
|
java.lang.Object |
getParameters()
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.
|
TagManager |
getTags()
Key-value pairs to associate with this stack.
|
java.lang.String |
getTemplateUrl()
Location of file containing the template body.
|
java.lang.Number |
getTimeoutInMinutes()
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the `CREATE_COMPLETE` state.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setNotificationArns(java.util.List<java.lang.String> value)
The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events.
|
void |
setParameters(IResolvable value)
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.String> value)
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.
|
void |
setTemplateUrl(java.lang.String value)
Location of file containing the template body.
|
void |
setTimeoutInMinutes(java.lang.Number value)
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the `CREATE_COMPLETE` state.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnStack(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnStack(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnStack(Construct scope, java.lang.String id, CfnStackProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
public java.lang.String getTemplateUrl()
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.
public void setTemplateUrl(java.lang.String value)
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.
public java.util.List<java.lang.String> getNotificationArns()
You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
public void setNotificationArns(java.util.List<java.lang.String> value)
You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
public java.lang.Object getParameters()
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.
public void setParameters(IResolvable value)
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.
public void setParameters(java.util.Map<java.lang.String,java.lang.String> value)
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.
public java.lang.Number getTimeoutInMinutes()
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.
public void setTimeoutInMinutes(java.lang.Number value)
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.