Table of Contents

Class CfnRefElement

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

Base class for referenceable CloudFormation constructs which are not Resources.

public abstract class CfnRefElement : CfnElement, IConstruct, IConstruct, IDependable
Inheritance
CfnRefElement
Implements
IConstruct
Derived
Inherited Members

Remarks

These constructs are things like Conditions and Parameters, can be referenced by taking the .ref attribute.

Resource constructs do not inherit from CfnRefElement because they have their own, more specific types returned from the .ref attribute. Also, some resources aren't referenceable at all (such as BucketPolicies or GatewayAttachments).

Constructors

CfnRefElement(Construct, string)

Creates an entity and binds it to a tree.

protected CfnRefElement(Construct scope, string id)

Parameters

scope Construct

The parent construct.

id string

Remarks

Note that the root of the tree must be a Stack object (not just any Root).

Properties

Ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

public virtual string Ref { get; }

Property Value

string

Remarks

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).