Class CfnStack
A CloudFormation AWS::CloudFormation::Stack
.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFormation
Assembly: Amazon.CDK.AWS.CloudFormation.dll
Syntax (csharp)
public class CfnStack : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnStack
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
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 .
CloudformationResource: AWS::CloudFormation::Stack
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFormation;
var cfnStack = new CfnStack(this, "MyCfnStack", new CfnStackProps {
TemplateUrl = "templateUrl",
// the properties below are optional
NotificationArns = new [] { "notificationArns" },
Parameters = new Dictionary<string, string> {
{ "parametersKey", "parameters" }
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TimeoutInMinutes = 123
});
Synopsis
Constructors
CfnStack(Construct, String, ICfnStackProps) | Create a new |
CfnStack(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnStack(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
NotificationArns | The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events. |
Parameters | The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created. |
Tags | Key-value pairs to associate with this stack. |
TemplateUrl | Location of file containing the template body. |
TimeoutInMinutes | The length of time, in minutes, that CloudFormation waits for the nested stack to reach the |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnStack(Construct, String, ICfnStackProps)
Create a new AWS::CloudFormation::Stack
.
public CfnStack(Construct scope, string id, ICfnStackProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnStackProps
- resource properties.
CfnStack(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnStack(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnStack(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnStack(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
NotificationArns
The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events.
public virtual string[] NotificationArns { get; set; }
Property Value
System.String[]
Remarks
You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).
Parameters
The set value pairs that represent the parameters passed to CloudFormation when this nested stack is created.
public virtual object Parameters { get; set; }
Property Value
System.Object
Remarks
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.
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.
Tags
Key-value pairs to associate with this stack.
public virtual TagManager Tags { get; }
Property Value
Remarks
AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.
TemplateUrl
Location of file containing the template body.
public virtual string TemplateUrl { get; set; }
Property Value
System.String
Remarks
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.
TimeoutInMinutes
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the CREATE_COMPLETE
state.
public virtual Nullable<double> TimeoutInMinutes { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>