aws-cdk-lib.Reference

class Reference

LanguageType name
.NETAmazon.CDK.Reference
Gogithub.com/aws/aws-cdk-go/awscdk/v2#Reference
Javasoftware.amazon.awscdk.Reference
Pythonaws_cdk.Reference
TypeScript (source)aws-cdk-lib » Reference

Implements IResolvable

Extends Intrinsic

Obtainable from AwsCustomResource.getResponseFieldReference(), CfnResource.getAtt(), CustomResource.getAtt(), ApiCallBase.getAtt()

An intrinsic Token that represents a reference to a construct.

References are recorded.

Initializer

new Reference(value: any, target: IConstruct, displayName?: string, typeHint?: ResolutionTypeHint)

Parameters

  • value any
  • target IConstruct
  • displayName string
  • typeHint ResolutionTypeHint — Type that the Intrinsic is expected to evaluate to.

Properties

NameTypeDescription
creationStackstring[]The captured stack trace which represents the location in which this token was created.
displayNamestring
targetIConstruct
typeHint?ResolutionTypeHintType that the Intrinsic is expected to evaluate to.

creationStack

Type: string[]

The captured stack trace which represents the location in which this token was created.


displayName

Type: string


target

Type: IConstruct


typeHint?

Type: ResolutionTypeHint (optional)

Type that the Intrinsic is expected to evaluate to.

Methods

NameDescription
resolve(_context)Produce the Token's value at resolution time.
toJSON()Turn this Token into JSON.
toString()Convert an instance of this Token to a string.
toStringList()Convert an instance of this Token to a string list.
static isReference(x)Check whether this is actually a Reference.

resolve(_context)

public resolve(_context: IResolveContext): any

Parameters

  • _context IResolveContext

Returns

  • any

Produce the Token's value at resolution time.


toJSON()

public toJSON(): any

Returns

  • any

Turn this Token into JSON.

Called automatically when JSON.stringify() is called on a Token.


toString()

public toString(): string

Returns

  • string

Convert an instance of this Token to a string.

This method will be called implicitly by language runtimes if the object is embedded into a string. We treat it the same as an explicit stringification.


toStringList()

public toStringList(): string[]

Returns

  • string[]

Convert an instance of this Token to a string list.

This method will be called implicitly by language runtimes if the object is embedded into a list. We treat it the same as an explicit stringification.


static isReference(x)

public static isReference(x: any): boolean

Parameters

  • x any

Returns

  • boolean

Check whether this is actually a Reference.