Skip to main content
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 cdktn

cdktn.Token()
NameTypeDescription

Static Functions

NameDescription
as_anyReturn a resolvable representation of the given value.
as_any_mapReturn a reversible map representation of this token.
as_boolean_mapReturn a reversible map representation of this token.
as_listReturn a reversible list representation of this token.
as_mapReturn a reversible map representation of this token.
as_numberReturn a reversible number representation of this token.
as_number_listReturn a reversible list representation of this token.
as_number_mapReturn a reversible map representation of this token.
as_stringReturn a reversible string representation of this token.
as_string_mapReturn a reversible map representation of this token.
is_unresolvedReturns true if obj represents an unresolved value.
null_valueReturn a Token containing a null value.

as_any

import cdktn

cdktn.Token.as_any(
  value: typing.Any
)
Return a resolvable representation of the given value.

valueRequired

  • Type: typing.Any

as_any_map

import cdktn

cdktn.Token.as_any_map(
  value: typing.Any,
  display_hint: str = None
)
Return a reversible map representation of this token.

valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_boolean_map

import cdktn

cdktn.Token.as_boolean_map(
  value: typing.Any,
  display_hint: str = None
)
Return a reversible map representation of this token.

valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_list

import cdktn

cdktn.Token.as_list(
  value: typing.Any,
  display_hint: str = None
)
Return a reversible list representation of this token.

valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_map

import cdktn

cdktn.Token.as_map(
  value: typing.Any,
  map_value: typing.Any,
  display_hint: str = None
)
Return a reversible map representation of this token.

valueRequired

  • Type: typing.Any

map_valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_number

import cdktn

cdktn.Token.as_number(
  value: typing.Any
)
Return a reversible number representation of this token.

valueRequired

  • Type: typing.Any

as_number_list

import cdktn

cdktn.Token.as_number_list(
  value: typing.Any
)
Return a reversible list representation of this token.

valueRequired

  • Type: typing.Any

as_number_map

import cdktn

cdktn.Token.as_number_map(
  value: typing.Any,
  display_hint: str = None
)
Return a reversible map representation of this token.

valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_string

import cdktn

cdktn.Token.as_string(
  value: typing.Any,
  display_hint: str = None
)
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

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

as_string_map

import cdktn

cdktn.Token.as_string_map(
  value: typing.Any,
  display_hint: str = None
)
Return a reversible map representation of this token.

valueRequired

  • Type: typing.Any

display_hintOptional

  • Type: str
  • Default: no display hint
A hint for the Token’s purpose when stringifying it.

is_unresolved

import cdktn

cdktn.Token.is_unresolved(
  obj: typing.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

  • Type: typing.Any
The object to test.

null_value

import cdktn

cdktn.Token.null_value()
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

NameTypeDescription
ANY_MAP_TOKEN_VALUEstrAny map token representation.
NUMBER_MAP_TOKEN_VALUEtyping.Union[int, float]Number Map token value representation.
STRING_MAP_TOKEN_VALUEstrString Map token value representation.

ANY_MAP_TOKEN_VALUERequired

ANY_MAP_TOKEN_VALUE: str
  • Type: str
Any map token representation.

NUMBER_MAP_TOKEN_VALUERequired

NUMBER_MAP_TOKEN_VALUE: typing.Union[int, float]
  • Type: typing.Union[int, float]
Number Map token value representation.

STRING_MAP_TOKEN_VALUERequired

STRING_MAP_TOKEN_VALUE: str
  • Type: str
String Map token value representation.