# Token

Represents a special or lazily-evaluated value.

Can be used to delay evaluation of a certain value in case, for example,
that it requires some context or late-bound data. Can also be used to
mark values that need special processing at document rendering time.

Tokens can be embedded into strings while retaining their original
semantics.

- Source: [`core/lib/token.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/token.ts#L49)
- Type last changed: v2.239.0 · 19 Feb 2026

## Methods

- `asAny(value: any): IResolvable` (static) — Return a resolvable representation of the given value.

- `asList(value: any, options?: EncodingOptions): string[]` (static) — Return a reversible list representation of this token.

- `asNumber(value: any): number` (static) — Return a reversible number representation of this token.

- `asString(value: any, options?: EncodingOptions): string` (static) — Return a reversible string representation of this token.

  If the Token is initialized with a literal, the stringified value of the
  literal is returned. Otherwise, a special quoted string representation
  of the Token is returned that can be embedded into other strings.

  Strings with quoted Tokens in them can be restored back into
  complex values with the Tokens restored by calling `resolve()`
  on the string.

- `compareStrings(possibleToken1: string, possibleToken2: string): TokenComparison` (static) — Compare two strings that might contain Tokens with each other.

- `isResolved(obj: any): boolean` (static) — The negation of `Token.isUnresolved()`. In TypeScript, narrows the type to exclude `IResolvable`.

  **Parameters**

  - `obj` — The object to test.

- `isUnresolved(obj: any): boolean` (static) — Returns true if obj represents an unresolved value.

  One of these must be true:

  - `obj` is an IResolvable
  - `obj` is a string containing at least one encoded `IResolvable`
  - `obj` is either an encoded number or list

  This does NOT recurse into lists or objects to see if they
  contain resolvables.

  **Parameters**

  - `obj` — The object to test.
