Class CfnElement
An element of a CloudFormation stack.
public abstract class CfnElement : Construct, IConstruct, IConstruct, IDependable
- Inheritance
-
CfnElement
- Implements
-
IConstruct
- Derived
- Inherited Members
Constructors
CfnElement(Construct, string)
Creates an entity and binds it to a tree.
protected CfnElement(Construct scope, string id)
Parameters
scope
ConstructThe parent construct.
id
string
Remarks
Note that the root of the tree must be a Stack object (not just any Root).
Properties
CreationStack
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
- string
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
- bool
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
stringThe new logical ID to use for this stack element.