Documentation Index
Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
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.
Initializers
import { Token } from 'cdktn'
new Token()
Static Functions
| Name | Description |
|---|
asAny | Return a resolvable representation of the given value. |
asAnyMap | Return a reversible map representation of this token. |
asBooleanMap | Return a reversible map representation of this token. |
asList | Return a reversible list representation of this token. |
asMap | Return a reversible map representation of this token. |
asNumber | Return a reversible number representation of this token. |
asNumberList | Return a reversible list representation of this token. |
asNumberMap | Return a reversible map representation of this token. |
asString | Return a reversible string representation of this token. |
asStringMap | Return a reversible map representation of this token. |
isUnresolved | Returns true if obj represents an unresolved value. |
nullValue | Return a Token containing a null value. |
asAny
import { Token } from 'cdktn'
Token.asAny(value: any)
Return a resolvable representation of the given value.
valueRequired
asAnyMap
import { Token } from 'cdktn'
Token.asAnyMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
valueRequired
optionsOptional
asBooleanMap
import { Token } from 'cdktn'
Token.asBooleanMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
valueRequired
optionsOptional
asList
import { Token } from 'cdktn'
Token.asList(value: any, options?: EncodingOptions)
Return a reversible list representation of this token.
valueRequired
optionsOptional
asMap
import { Token } from 'cdktn'
Token.asMap(value: any, mapValue: any, options?: EncodingOptions)
Return a reversible map representation of this token.
valueRequired
mapValueRequired
optionsOptional
asNumber
import { Token } from 'cdktn'
Token.asNumber(value: any)
Return a reversible number representation of this token.
valueRequired
asNumberList
import { Token } from 'cdktn'
Token.asNumberList(value: any)
Return a reversible list representation of this token.
valueRequired
asNumberMap
import { Token } from 'cdktn'
Token.asNumberMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
valueRequired
optionsOptional
asString
import { Token } from 'cdktn'
Token.asString(value: any, options?: EncodingOptions)
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.
valueRequired
optionsOptional
asStringMap
import { Token } from 'cdktn'
Token.asStringMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
valueRequired
optionsOptional
isUnresolved
import { Token } from 'cdktn'
Token.isUnresolved(obj: any)
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
containing resolvables.
objRequired
The object to test.
nullValue
import { Token } from 'cdktn'
Token.nullValue()
Return a Token containing a null value.
Note: This is different than undefined, nil, None or similar
as it will end up in the Terraform config and can be used to explicitly
not set an attribute (which is sometimes required by Terraform providers)
Constants
| Name | Type | Description |
|---|
ANY_MAP_TOKEN_VALUE | string | Any map token representation. |
NUMBER_MAP_TOKEN_VALUE | number | Number Map token value representation. |
STRING_MAP_TOKEN_VALUE | string | String Map token value representation. |
ANY_MAP_TOKEN_VALUERequired
public readonly ANY_MAP_TOKEN_VALUE: string;
Any map token representation.
NUMBER_MAP_TOKEN_VALUERequired
public readonly NUMBER_MAP_TOKEN_VALUE: number;
Number Map token value representation.
STRING_MAP_TOKEN_VALUERequired
public readonly STRING_MAP_TOKEN_VALUE: string;
String Map token value representation.