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 "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.NewToken() Token
NameTypeDescription

Static Functions

NameDescription
AsAnyReturn a resolvable representation of the given value.
AsAnyMapReturn a reversible map representation of this token.
AsBooleanMapReturn a reversible map representation of this token.
AsListReturn a reversible list representation of this token.
AsMapReturn a reversible map representation of this token.
AsNumberReturn a reversible number representation of this token.
AsNumberListReturn a reversible list representation of this token.
AsNumberMapReturn a reversible map representation of this token.
AsStringReturn a reversible string representation of this token.
AsStringMapReturn a reversible map representation of this token.
IsUnresolvedReturns true if obj represents an unresolved value.
NullValueReturn a Token containing a null value.

AsAny

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsAny(value interface{}) IResolvable
Return a resolvable representation of the given value.

valueRequired

  • Type: interface{}

AsAnyMap

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsAnyMap(value interface{}, options EncodingOptions) *map[string]interface{}
Return a reversible map representation of this token.

valueRequired

  • Type: interface{}

optionsOptional


AsBooleanMap

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsBooleanMap(value interface{}, options EncodingOptions) *map[string]*bool
Return a reversible map representation of this token.

valueRequired

  • Type: interface{}

optionsOptional


AsList

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsList(value interface{}, options EncodingOptions) *[]*string
Return a reversible list representation of this token.

valueRequired

  • Type: interface{}

optionsOptional


AsMap

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsMap(value interface{}, mapValue interface{}, options EncodingOptions) *map[string]interface{}
Return a reversible map representation of this token.

valueRequired

  • Type: interface{}

mapValueRequired

  • Type: interface{}

optionsOptional


AsNumber

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumber(value interface{}) *f64
Return a reversible number representation of this token.

valueRequired

  • Type: interface{}

AsNumberList

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumberList(value interface{}) *[]*f64
Return a reversible list representation of this token.

valueRequired

  • Type: interface{}

AsNumberMap

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumberMap(value interface{}, options EncodingOptions) *map[string]*f64
Return a reversible map representation of this token.

valueRequired

  • Type: interface{}

optionsOptional


AsString

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsString(value interface{}, options EncodingOptions) *string
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: interface{}

optionsOptional


AsStringMap

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsStringMap(value interface{}, options EncodingOptions) *map[string]*string
Return a reversible map representation of this token.

valueRequired

  • Type: interface{}

optionsOptional


IsUnresolved

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_IsUnresolved(obj interface{}) *bool
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: interface{}
The object to test.

NullValue

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_NullValue() IResolvable
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
AnyMapTokenValue*stringAny map token representation.
NumberMapTokenValue*f64Number Map token value representation.
StringMapTokenValue*stringString Map token value representation.

AnyMapTokenValueRequired

func AnyMapTokenValue() *string
  • Type: *string
Any map token representation.

NumberMapTokenValueRequired

func NumberMapTokenValue() *f64
  • Type: *f64
Number Map token value representation.

StringMapTokenValueRequired

func StringMapTokenValue() *string
  • Type: *string
String Map token value representation.