# CfnDynamicReference

References a dynamically retrieved value.

This is a Construct so that subclasses will (eventually) be able to attach
metadata to themselves without having to change call signatures.

Extends: Intrinsic › CfnDynamicReference
Implements: IResolvable

- Source: [`core/lib/cfn-dynamic-reference.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/core/lib/cfn-dynamic-reference.ts#L26)

## Example

```ts
new CfnDynamicReference(
  CfnDynamicReferenceService.SECRETS_MANAGER,
  'secret-id:secret-string:json-key:version-stage:version-id',
);
```

## Initializer

```ts
new CfnDynamicReference(service: CfnDynamicReferenceService, key: string)
```

## Properties

- `creationStack`: string[] (required) — The captured stack trace which represents the location in which this token was created.

- `typeHint`: [ResolutionTypeHint](/cdk/api/v2/docs/aws-cdk-lib.ResolutionTypeHint.html) — Type that the Intrinsic is expected to evaluate to.

## Methods

- `resolve(_context: IResolveContext): any` — Produce the Token's value at resolution time.

- `toJSON(): any` — Turn this Token into JSON.

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

- `toString(): 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(): 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.
