Class CfnStack
The AWS::CloudFormation::Stack
resource nests a stack as a resource in a top-level template.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFormation
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnStack : CfnResource, IInspectable, ITaggable
Syntax (vb)
Public Class CfnStack
Inherits CfnResource
Implements IInspectable, ITaggable
Remarks
For more information, see Embed stacks within other stacks using nested stacks in the AWS CloudFormation User Guide .
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.
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 in the AWS CloudFormation User Guide .
A subset of AWS::CloudFormation::Stack
resource type properties listed below are available to customers using CloudFormation , AWS CDK , and AWS Cloud Control API to configure.
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 CloudFormation or AWS CDK but only AWS Cloud Control API .
Customers that configure AWS::CloudFormation::Stack
using 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 .
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stack.html
CloudformationResource: AWS::CloudFormation::Stack
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 {
NotificationArns = new [] { "notificationArns" },
Parameters = new Dictionary<string, string> {
{ "parametersKey", "parameters" }
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TemplateUrl = "templateUrl",
TimeoutInMinutes = 123
});
Synopsis
Constructors
Cfn |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Cfn |
Used by jsii to construct an instance of this class from DeputyProps |
Cfn |
Properties
Attr |
Returns the unique ID of the change set. |
Attr |
Returns The time at which the stack was created. |
Attr |
Returns the time the stack was last updated. |
Attr |
Returns a list of output structures. |
Attr |
For nested stacks--stacks created as resources for another stack--returns the stack ID of the direct parent of this stack. |
Attr |
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. |
Attr |
Returns the unique identifier of the stack. |
Attr |
Returns a success or failure message associated with the stack status. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
Cfn |
|
Notification |
The 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 | Tag Manager which manages the tags for this resource. |
Tags |
Key-value pairs to associate with this stack. |
Template |
The URL of a file containing the template body. |
Timeout |
The length of time, in minutes, that CloudFormation waits for the nested stack to reach the |
Methods
Inspect(Tree |
Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
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. By Ref Value 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. Deputy Base. Deputy Props The deputy props
CfnStack(Construct, String, ICfnStackProps)
public CfnStack(Construct scope, string id, ICfnStackProps props = null)
Parameters
- scope Constructs.
Construct Scope in which this resource is defined.
- id System.
String Construct identifier for this resource (unique in its scope).
- props ICfn
Stack Props Resource properties.
Properties
AttrChangeSetId
Returns the unique ID of the change set.
public virtual string AttrChangeSetId { get; }
Property Value
System.
Remarks
CloudformationAttribute: ChangeSetId
AttrCreationTime
Returns The time at which the stack was created.
public virtual string AttrCreationTime { get; }
Property Value
System.
Remarks
CloudformationAttribute: CreationTime
AttrLastUpdateTime
Returns the time the stack was last updated.
public virtual string AttrLastUpdateTime { get; }
Property Value
System.
Remarks
This will only be returned if the stack has been updated at least once.
CloudformationAttribute: LastUpdateTime
AttrOutputs
Returns a list of output structures.
public virtual IResolvable AttrOutputs { get; }
Property Value
Remarks
CloudformationAttribute: Outputs
AttrParentId
For nested stacks--stacks created as resources for another stack--returns the stack ID of the direct parent of this stack.
public virtual string AttrParentId { get; }
Property Value
System.
Remarks
For the first level of nested stacks, the root stack is also the parent stack.
CloudformationAttribute: ParentId
AttrRootId
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.
public virtual string AttrRootId { get; }
Property Value
System.
Remarks
CloudformationAttribute: RootId
AttrStackId
Returns the unique identifier of the stack.
public virtual string AttrStackId { get; }
Property Value
System.
Remarks
CloudformationAttribute: StackId
AttrStackStatus
Returns a success or failure message associated with the stack status.
public virtual string AttrStackStatus { get; }
Property Value
System.
Remarks
CloudformationAttribute: StackStatus
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.
Overrides
NotificationArns
The Amazon SNS topic ARNs to publish stack related events.
public virtual string[] NotificationArns { get; set; }
Property Value
System.
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.
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
TagsRaw
Key-value pairs to associate with this stack.
public virtual ICfnTag[] TagsRaw { get; set; }
Property Value
ICfn
TemplateUrl
The URL of a file containing the template body.
public virtual string TemplateUrl { get; set; }
Property Value
System.
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.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector Tree
Inspector 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. <System.Generic. IDictionary String , System.Object >
Returns
System.