Class CfnElement
An element of a CloudFormation stack.
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class CfnElement : Construct
Syntax (vb)
Public MustInherit Class CfnElement Inherits Construct
Synopsis
Constructors
| CfnElement(Construct, string) | Creates an entity and binds it to a tree. |
Properties
| CreationStack | An element of a CloudFormation stack. |
| LogicalId | The logical ID for this CloudFormation stack element. |
| Stack | The stack in which this element is defined. |
Methods
| IsCfnElement(object) | Returns |
| OverrideLogicalId(string) | Overrides the auto-generated logical ID with a specific ID. |
| With(params IMixin[]) | Applies one or more mixins to this construct. |
Constructors
CfnElement(Construct, string)
Creates an entity and binds it to a tree.
protected CfnElement(Construct scope, string id)
Parameters
- scope Construct
The parent construct.
- id string
The parent construct.
Remarks
Note that the root of the tree must be a Stack object (not just any Root).
Properties
CreationStack
An element of a CloudFormation stack.
public virtual string[] CreationStack { get; }
Property Value
string[]
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
LogicalId
The logical ID for this CloudFormation stack element.
public virtual string LogicalId { get; }
Property Value
the logical ID as a stringified token. This value will only get resolved during synthesis.
Remarks
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId).
Stack
The stack in which this element is defined.
public virtual Stack Stack { get; }
Property Value
Remarks
CfnElements must be defined within a stack scope (directly or indirectly).
Methods
IsCfnElement(object)
Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).
public static bool IsCfnElement(object x)
Parameters
- x object
Returns
The construct as a stack element or undefined if it is not a stack element.
Remarks
Uses duck-typing instead of instanceof to allow stack elements from different
versions of this library to be included in the same stack.
OverrideLogicalId(string)
Overrides the auto-generated logical ID with a specific ID.
public virtual void OverrideLogicalId(string newLogicalId)
Parameters
- newLogicalId string
The new logical ID to use for this stack element.
With(params IMixin[])
Applies one or more mixins to this construct.
public override IConstruct With(params IMixin[] mixins)
Parameters
- mixins IMixin[]
Returns
IConstruct
Remarks
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.