Table of Contents

Class CfnStack

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

A CloudFormation AWS::CloudFormation::Stack.

public class CfnStack : CfnResource, IConstruct, IConstruct, IDependable, IInspectable
Inheritance
CfnStack
Implements
IConstruct
Inherited Members

Examples

// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK;
             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
             });

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 <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html">Controlling access with AWS Identity and Access Management</a> .

CloudformationResource: AWS::CloudFormation::Stack

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html

ExampleMetadata: fixture=_generated

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 string
  • scoped id of the resource.
props ICfnStackProps
  • resource properties.

Properties

CFN_RESOURCE_TYPE_NAME

The CloudFormation resource type name for this resource class.

public static string CFN_RESOURCE_TYPE_NAME { get; }

Property Value

string

CfnProperties

protected override IDictionary<string, object> CfnProperties { get; }

Property Value

IDictionary<string, object>

NotificationArns

The Amazon Simple Notification Service (Amazon SNS) topic ARNs to publish stack related events.

public virtual string[]? NotificationArns { get; set; }

Property Value

string[]

Remarks

You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI).

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-notificationarns

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

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 <code>Ref</code> function to pass a parameter value to a nested stack, comma-delimited list parameters must be of type <code>String</code> . In other words, you can't pass values that are of type <code>CommaDelimitedList</code> 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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-parameters

Tags

Key-value pairs to associate with this stack.

public virtual TagManager Tags { get; }

Property Value

TagManager

Remarks

AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-tags

TemplateUrl

Location of file containing the template body.

public virtual string TemplateUrl { get; set; }

Property Value

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-templateurl

TimeoutInMinutes

The length of time, in minutes, that CloudFormation waits for the nested stack to reach the CREATE_COMPLETE state.

public virtual double? TimeoutInMinutes { get; set; }

Property Value

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.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html#cfn-cloudformation-stack-timeoutinminutes

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 IDictionary<string, object>

Returns

IDictionary<string, object>