# 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](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Intrinsic.html) › CfnDynamicReference
Implements: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

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

## Example

TypeScript:

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

Python:

```python
CfnDynamicReference(CfnDynamicReferenceService.SECRETS_MANAGER, "secret-id:secret-string:json-key:version-stage:version-id")
```

Java:

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

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new CfnDynamicReference(CfnDynamicReferenceService.SECRETS_MANAGER, "secret-id:secret-string:json-key:version-stage:version-id");
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
awscdk.NewCfnDynamicReference(awscdk.CfnDynamicReferenceService_SECRETS_MANAGER, jsii.String("secret-id:secret-string:json-key:version-stage:version-id"))
```

## Initializer

TypeScript:

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

Python:

```python
CfnDynamicReference(service: CfnDynamicReferenceService, key: str)
```

Java:

```java
new CfnDynamicReference(CfnDynamicReferenceService service, String key)
```

C# / .NET:

```csharp
new CfnDynamicReference(CfnDynamicReferenceService service, string key)
```

Golang:

```go
NewCfnDynamicReference(Service CfnDynamicReferenceService, Key *string)
```

## Properties

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

- `typeHint`: [ResolutionTypeHint](https://docs.aws.amazon.com/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.
