Terraform
Typescript: Classes
Annotations
Includes API for attaching annotations such as warning messages to constructs.
Methods
Name | Description |
---|---|
addError | Adds an { "error": < message > } metadata entry to this construct. |
addInfo | Adds an info metadata entry to this construct. |
addWarning | Adds a warning metadata entry to this construct. |
addError
public addError(message: string): void
Adds an { "error": < message > } metadata entry to this construct.
The toolkit will fail synthesis when errors are reported.
message
Required
- Type: string
The error message.
addInfo
public addInfo(message: string): void
Adds an info metadata entry to this construct.
The CLI will display the info message when apps are synthesized.
message
Required
- Type: string
The info message.
addWarning
public addWarning(message: string): void
Adds a warning metadata entry to this construct.
The CLI will display the warning when an app is synthesized. In a future release the CLI might introduce a --strict flag which will then fail the synthesis if it encounters a warning.
message
Required
- Type: string
The warning message.
Static Functions
Name | Description |
---|---|
of | Returns the annotations API for a construct scope. |
of
import { Annotations } from 'cdktf'
Annotations.of(scope: IConstruct)
Returns the annotations API for a construct scope.
scope
Required
- Type: constructs.IConstruct
The scope.
AnyListList
Initializers
import { AnyListList } from 'cdktf'
new AnyListList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): IResolvable
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
AnyListMap
Initializers
import { AnyListMap } from 'cdktf'
new AnyListMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(key: string): IResolvable
key
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
AnyMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import { AnyMap } from 'cdktf'
new AnyMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
lookup
public lookup(key: string): any
key
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
AnyMapList
Initializers
import { AnyMapList } from 'cdktf'
new AnyMapList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): AnyMap
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
Aspects
Aspects can be applied to CDK tree scopes and can operate on the tree before synthesis.
Methods
Name | Description |
---|---|
add | Adds an aspect to apply this scope before synthesis. |
add
public add(aspect: IAspect): void
Adds an aspect to apply this scope before synthesis.
aspect
Required
- Type: IAspect
The aspect to add.
Static Functions
Name | Description |
---|---|
of | Returns the Aspects object associated with a construct scope. |
of
import { Aspects } from 'cdktf'
Aspects.of(scope: IConstruct)
Returns the Aspects
object associated with a construct scope.
scope
Required
- Type: constructs.IConstruct
The scope for which these aspects will apply.
Properties
all
Required
public readonly all: IAspect[];
- Type: IAspect[]
The list of aspects which were directly applied on this scope.
AssertionReturn
Class representing the contents of a return by an assertion.
Initializers
import { testingMatchers } from 'cdktf'
new testingMatchers.AssertionReturn(message: string, pass: boolean)
Name | Type | Description |
---|---|---|
message | string | - String message containing information about the result of the assertion. |
pass | boolean | - Boolean pass denoting the success of the assertion. |
message
Required
- Type: string
String message containing information about the result of the assertion.
pass
Required
- Type: boolean
Boolean pass denoting the success of the assertion.
Properties
Name | Type | Description |
---|---|---|
message | string | - String message containing information about the result of the assertion. |
pass | boolean | - Boolean pass denoting the success of the assertion. |
message
Required
public readonly message: string;
- Type: string
String message containing information about the result of the assertion.
pass
Required
public readonly pass: boolean;
- Type: boolean
Boolean pass denoting the success of the assertion.
BooleanList
Initializers
import { BooleanList } from 'cdktf'
new BooleanList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): IResolvable
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
BooleanListList
Initializers
import { BooleanListList } from 'cdktf'
new BooleanListList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): IResolvable
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
BooleanListMap
Initializers
import { BooleanListMap } from 'cdktf'
new BooleanListMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(key: string): IResolvable
key
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
BooleanMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import { BooleanMap } from 'cdktf'
new BooleanMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
lookup
public lookup(key: string): IResolvable
key
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
BooleanMapList
Initializers
import { BooleanMapList } from 'cdktf'
new BooleanMapList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): BooleanMap
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
CloudWorkspace
A cloud workspace can either be a single named workspace, or a list of tagged workspaces.
Initializers
import { CloudWorkspace } from "cdktf";
new CloudWorkspace();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
toTerraform | No description. |
toTerraform
public toTerraform(): any
ComplexComputedList
- Implements: IInterpolatingParent, IResolvable, ITerraformAddressable
Initializers
import { ComplexComputedList } from 'cdktf'
new ComplexComputedList(terraformResource: IInterpolatingParent, terraformAttribute: string, complexComputedListIndex: string, wrapsSet?: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
complexComputedListIndex | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
complexComputedListIndex
Required
- Type: string
wrapsSet
Optional
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
getAnyMapAttribute | No description. |
getBooleanAttribute | No description. |
getBooleanMapAttribute | No description. |
getListAttribute | No description. |
getNumberAttribute | No description. |
getNumberListAttribute | No description. |
getNumberMapAttribute | No description. |
getStringAttribute | No description. |
getStringMapAttribute | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
computeFqn
public computeFqn(): string
getAnyMapAttribute
getAnyMapAttribute
public getAnyMapAttribute(terraformAttribute: string): {[ key: string ]: any}
terraformAttribute
Required
- Type: string
getBooleanAttribute
getBooleanAttribute
public getBooleanAttribute(terraformAttribute: string): IResolvable
terraformAttribute
Required
- Type: string
getBooleanMapAttribute
getBooleanMapAttribute
public getBooleanMapAttribute(terraformAttribute: string): {[ key: string ]: boolean}
terraformAttribute
Required
- Type: string
getListAttribute
getListAttribute
public getListAttribute(terraformAttribute: string): string[]
terraformAttribute
Required
- Type: string
getNumberAttribute
getNumberAttribute
public getNumberAttribute(terraformAttribute: string): number
terraformAttribute
Required
- Type: string
getNumberListAttribute
getNumberListAttribute
public getNumberListAttribute(terraformAttribute: string): number[]
terraformAttribute
Required
- Type: string
getNumberMapAttribute
getNumberMapAttribute
public getNumberMapAttribute(terraformAttribute: string): {[ key: string ]: number}
terraformAttribute
Required
- Type: string
getStringAttribute
getStringAttribute
public getStringAttribute(terraformAttribute: string): string
terraformAttribute
Required
- Type: string
getStringMapAttribute
getStringMapAttribute
public getStringMapAttribute(terraformAttribute: string): {[ key: string ]: string}
terraformAttribute
Required
- Type: string
interpolationForAttribute
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
creationStack
- Deprecated: Going to be replaced by Array of ComplexListItem and will be removed in the future
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
fqn
- Deprecated: Going to be replaced by Array of ComplexListItem and will be removed in the future
public readonly fqn: string;
- Type: string
ComplexList
- Implements: ITerraformAddressable, IResolvable
Initializers
import { ComplexList } from 'cdktf'
new ComplexList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
ComplexMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import { ComplexMap } from 'cdktf'
new ComplexMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
ComplexObject
- Implements: IInterpolatingParent, IResolvable, ITerraformAddressable
Initializers
import { ComplexObject } from 'cdktf'
new ComplexObject(terraformResource: IInterpolatingParent, terraformAttribute: string, complexObjectIsFromSet: boolean, complexObjectIndex?: string | number)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
complexObjectIsFromSet | boolean | set to true if this item is from inside a set and needs tolist() for accessing it set to "0" for single list items. |
complexObjectIndex | string | number | the index of the complex object in a list. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
complexObjectIsFromSet
Required
- Type: boolean
set to true if this item is from inside a set and needs tolist() for accessing it set to "0" for single list items.
complexObjectIndex
Optional
- Type: string | number
the index of the complex object in a list.
Methods
Name | Description |
---|---|
computeFqn | No description. |
getAnyMapAttribute | No description. |
getBooleanAttribute | No description. |
getBooleanMapAttribute | No description. |
getListAttribute | No description. |
getNumberAttribute | No description. |
getNumberListAttribute | No description. |
getNumberMapAttribute | No description. |
getStringAttribute | No description. |
getStringMapAttribute | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
getAnyMapAttribute
public getAnyMapAttribute(terraformAttribute: string): {[ key: string ]: any}
terraformAttribute
Required
- Type: string
getBooleanAttribute
public getBooleanAttribute(terraformAttribute: string): IResolvable
terraformAttribute
Required
- Type: string
getBooleanMapAttribute
public getBooleanMapAttribute(terraformAttribute: string): {[ key: string ]: boolean}
terraformAttribute
Required
- Type: string
getListAttribute
public getListAttribute(terraformAttribute: string): string[]
terraformAttribute
Required
- Type: string
getNumberAttribute
public getNumberAttribute(terraformAttribute: string): number
terraformAttribute
Required
- Type: string
getNumberListAttribute
public getNumberListAttribute(terraformAttribute: string): number[]
terraformAttribute
Required
- Type: string
getNumberMapAttribute
public getNumberMapAttribute(terraformAttribute: string): {[ key: string ]: number}
terraformAttribute
Required
- Type: string
getStringAttribute
public getStringAttribute(terraformAttribute: string): string
terraformAttribute
Required
- Type: string
getStringMapAttribute
public getStringMapAttribute(terraformAttribute: string): {[ key: string ]: string}
terraformAttribute
Required
- Type: string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
DefaultTokenResolver
- Implements: ITokenResolver
Default resolver implementation.
Initializers
import { DefaultTokenResolver } from 'cdktf'
new DefaultTokenResolver(concat: IFragmentConcatenator)
Name | Type | Description |
---|---|---|
concat | IFragmentConcatenator | No description. |
concat
Required
- Type: IFragmentConcatenator
Methods
Name | Description |
---|---|
resolveList | Resolves a list of string. |
resolveMap | Resolves a map token. |
resolveNumberList | Resolves a list of numbers. |
resolveString | Resolve string fragments to Tokens. |
resolveToken | Default Token resolution. |
resolveList
public resolveList(xs: string[], context: IResolveContext): any
Resolves a list of string.
xs
Required
- Type: string[]
context
Required
- Type: IResolveContext
resolveMap
public resolveMap(xs: {[ key: string ]: any}, context: IResolveContext): any
Resolves a map token.
xs
Required
- Type: {[ key: string ]: any}
context
Required
- Type: IResolveContext
resolveNumberList
public resolveNumberList(xs: number[], context: IResolveContext): any
Resolves a list of numbers.
xs
Required
- Type: number[]
context
Required
- Type: IResolveContext
resolveString
public resolveString(fragments: TokenizedStringFragments, context: IResolveContext): any
Resolve string fragments to Tokens.
fragments
Required
- Type: TokenizedStringFragments
context
Required
- Type: IResolveContext
resolveToken
public resolveToken(t: IResolvable, context: IResolveContext, postProcessor: IPostProcessor): any
Default Token resolution.
Resolve the Token, recurse into whatever it returns, then finally post-process it.
t
Required
- Type: IResolvable
context
Required
- Type: IResolveContext
postProcessor
Required
- Type: IPostProcessor
DynamicListTerraformIterator
Initializers
import { DynamicListTerraformIterator } from 'cdktf'
new DynamicListTerraformIterator(list: string[] | IResolvable | number[] | boolean | IResolvable[], mapKeyAttributeName: string)
Name | Type | Description |
---|---|---|
list | string[] | IResolvable | number[] | boolean | IResolvable[] | No description. |
mapKeyAttributeName | string | No description. |
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
mapKeyAttributeName
Required
- Type: string
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
forExpressionForList | Creates a for expression that results in a list. |
forExpressionForMap | Creates a for expression that results in a map. |
getAny | No description. |
getAnyMap | No description. |
getBoolean | No description. |
getBooleanMap | No description. |
getList | No description. |
getMap | No description. |
getNumber | No description. |
getNumberList | No description. |
getNumberMap | No description. |
getString | No description. |
getStringMap | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluckProperty | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
public dynamic(attributes: {[ key: string ]: any}): IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: {[ key: string ]: any}
forExpressionForList
public forExpressionForList(expression: string | IResolvable): IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: string | IResolvable
The expression to use in the for mapping.
forExpressionForMap
public forExpressionForMap(keyExpression: string | IResolvable, valueExpression: string | IResolvable): IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
keyExpression
Required
- Type: string | IResolvable
The expression to use as key in the for mapping.
valueExpression
Required
- Type: string | IResolvable
The expression to use as value in the for mapping.
getAny
public getAny(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getAnyMap
public getAnyMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getBoolean
public getBoolean(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getBooleanMap
public getBooleanMap(attribute: string): {[ key: string ]: boolean}
attribute
Required
- Type: string
name of the property to retrieve.
getList
public getList(attribute: string): string[]
attribute
Required
- Type: string
name of the property to retrieve.
getMap
public getMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getNumber
public getNumber(attribute: string): number
attribute
Required
- Type: string
name of the property to retrieve.
getNumberList
public getNumberList(attribute: string): number[]
attribute
Required
- Type: string
name of the property to retrieve.
getNumberMap
public getNumberMap(attribute: string): {[ key: string ]: number}
attribute
Required
- Type: string
name of the property to retrieve.
getString
public getString(attribute: string): string
attribute
Required
- Type: string
name of the property to retrieve.
getStringMap
public getStringMap(attribute: string): {[ key: string ]: string}
attribute
Required
- Type: string
name of the property to retrieve.
keys
public keys(): IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluckProperty
public pluckProperty(property: string): IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: string
The property of the iterators values to map to.
values
public values(): IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
fromComplexList | Creates a new iterator from a complex list. |
fromDataSources | Creates a new iterator from a data source that has been created with the for_each argument. |
fromList | Creates a new iterator from a list. |
fromMap | Creates a new iterator from a map. |
fromResources | Creates a new iterator from a resource that has been created with the for_each argument. |
fromComplexList
import { DynamicListTerraformIterator } from 'cdktf'
DynamicListTerraformIterator.fromComplexList(list: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList, mapKeyAttributeName: string)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
const cert = new AcmCertificate(this, "cert", {
domainName: "example.com",
validationMethod: "DNS",
});
const dvoIterator = TerraformIterator.fromComplexList(
cert.domainValidationOptions,
"domain_name"
);
new Route53Record(this, "record", {
allowOverwrite: true,
name: dvoIterator.getString("name"),
records: [dvoIterator.getString("record")],
ttl: 60,
type: dvoIterator.getString("type"),
zoneId: Token.asString(dataAwsRoute53ZoneExample.zoneId),
forEach: dvoIterator,
});
list
Required
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
the list to iterate over.
mapKeyAttributeName
Required
- Type: string
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
fromDataSources
import { DynamicListTerraformIterator } from 'cdktf'
DynamicListTerraformIterator.fromDataSources(resource: ITerraformResource)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
fromList
import { DynamicListTerraformIterator } from 'cdktf'
DynamicListTerraformIterator.fromList(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Creates a new iterator from a list.
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
import { DynamicListTerraformIterator } from 'cdktf'
DynamicListTerraformIterator.fromMap(map: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean})
Creates a new iterator from a map.
map
Required
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
import { DynamicListTerraformIterator } from 'cdktf'
DynamicListTerraformIterator.fromResources(resource: ITerraformResource)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
Properties
Name | Type | Description |
---|---|---|
key | string | Returns the key of the current entry in the map that is being iterated over. |
value | any | Returns the value of the current item iterated over. |
key
Required
public readonly key: string;
- Type: string
Returns the key of the current entry in the map that is being iterated over.
value
Required
public readonly value: any;
- Type: any
Returns the value of the current item iterated over.
Fn
Initializers
import { Fn } from "cdktf";
new Fn();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
abs | {@link https://developer.hashicorp.com/terraform/language/functions/abs abs} returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it. |
abspath | {@link https://developer.hashicorp.com/terraform/language/functions/abspath abspath} takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory. |
alltrue | {@link https://developer.hashicorp.com/terraform/language/functions/alltrue alltrue} returns true if all elements in a given collection are true or "true" . It also returns true if the collection is empty. |
anytrue | {@link https://developer.hashicorp.com/terraform/language/functions/anytrue anytrue} returns true if any element in a given collection is true or "true" . It also returns false if the collection is empty. |
base64decode | {@link https://developer.hashicorp.com/terraform/language/functions/base64decode base64decode} takes a string containing a Base64 character sequence and returns the original string. |
base64encode | {@link https://developer.hashicorp.com/terraform/language/functions/base64encode base64encode} applies Base64 encoding to a string. |
base64gzip | {@link https://developer.hashicorp.com/terraform/language/functions/base64gzip base64gzip} compresses a string with gzip and then encodes the result in Base64 encoding. |
base64sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha256 base64sha256} computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test")) since sha256() returns hexadecimal representation. |
base64sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha512 base64sha512} computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test")) since sha512() returns hexadecimal representation. |
basename | {@link https://developer.hashicorp.com/terraform/language/functions/basename basename} takes a string containing a filesystem path and removes all except the last portion from it. |
can | {@link https://developer.hashicorp.com/terraform/language/functions/can can} evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors. |
ceil | {@link https://developer.hashicorp.com/terraform/language/functions/ceil ceil} returns the closest whole number that is greater than or equal to the given value, which may be a fraction. |
chomp | {@link https://developer.hashicorp.com/terraform/language/functions/chomp chomp} removes newline characters at the end of a string. |
chunklist | {@link https://developer.hashicorp.com/terraform/language/functions/chunklist chunklist} splits a single list into fixed-size chunks, returning a list of lists. |
cidrhost | {@link https://developer.hashicorp.com/terraform/language/functions/cidrhost cidrhost} calculates a full host IP address for a given host number within a given IP network address prefix. |
cidrnetmask | {@link https://developer.hashicorp.com/terraform/language/functions/cidrnetmask cidrnetmask} converts an IPv4 address prefix given in CIDR notation into a subnet mask address. |
cidrsubnet | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnet cidrsubnet} calculates a subnet address within given IP network address prefix. |
cidrsubnets | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnets cidrsubnets} calculates a sequence of consecutive IP address ranges within a particular CIDR prefix. |
coalesce | {@link https://developer.hashicorp.com/terraform/language/functions/coalesce coalesce} takes any number of arguments and returns the first one that isn't null or an empty string. |
coalescelist | {@link https://developer.hashicorp.com/terraform/language/functions/coalescelist coalescelist} takes any number of list arguments and returns the first one that isn't empty. |
compact | {@link https://developer.hashicorp.com/terraform/language/functions/compact compact} takes a list of strings and returns a new list with any empty string elements removed. |
concat | {@link https://developer.hashicorp.com/terraform/language/functions/concat concat} takes two or more lists and combines them into a single list. |
contains | {@link https://developer.hashicorp.com/terraform/language/functions/contains contains} determines whether a given list or set contains a given single value as one of its elements. |
csvdecode | {@link https://developer.hashicorp.com/terraform/language/functions/csvdecode csvdecode} decodes a string containing CSV-formatted data and produces a list of maps representing that data. |
dirname | {@link https://developer.hashicorp.com/terraform/language/functions/dirname dirname} takes a string containing a filesystem path and removes the last portion from it. |
distinct | {@link https://developer.hashicorp.com/terraform/language/functions/distinct distinct} takes a list and returns a new list with any duplicate elements removed. |
element | {@link https://developer.hashicorp.com/terraform/language/functions/element element} retrieves a single element from a list. |
endswith | {@link https://developer.hashicorp.com/terraform/language/functions/endswith endswith} takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix. |
file | {@link https://developer.hashicorp.com/terraform/language/functions/file file} reads the contents of a file at the given path and returns them as a string. |
filebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64 filebase64} reads the contents of a file at the given path and returns them as a base64-encoded string. |
filebase64sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha256 filebase64sha256} is a variant of base64sha256 that hashes the contents of a given file rather than a literal string. |
filebase64sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha512 filebase64sha512} is a variant of base64sha512 that hashes the contents of a given file rather than a literal string. |
fileexists | {@link https://developer.hashicorp.com/terraform/language/functions/fileexists fileexists} determines whether a file exists at a given path. |
filemd5 | {@link https://developer.hashicorp.com/terraform/language/functions/filemd5 filemd5} is a variant of md5 that hashes the contents of a given file rather than a literal string. |
fileset | {@link https://developer.hashicorp.com/terraform/language/functions/fileset fileset} enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (/ ) as the path separator for cross-system compatibility. |
filesha1 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha1 filesha1} is a variant of sha1 that hashes the contents of a given file rather than a literal string. |
filesha256 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha256 filesha256} is a variant of sha256 that hashes the contents of a given file rather than a literal string. |
filesha512 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha512 filesha512} is a variant of sha512 that hashes the contents of a given file rather than a literal string. |
flatten | {@link https://developer.hashicorp.com/terraform/language/functions/flatten flatten} takes a list and replaces any elements that are lists with a flattened sequence of the list contents. |
floor | {@link https://developer.hashicorp.com/terraform/language/functions/floor floor} returns the closest whole number that is less than or equal to the given value, which may be a fraction. |
format | The {@link https://developer.hashicorp.com/terraform/language/functions/format format} function produces a string by formatting a number of other values according to a specification string. It is similar to the printf function in C, and other similar functions in other programming languages. |
formatdate | {@link https://developer.hashicorp.com/terraform/language/functions/formatdate formatdate} converts a timestamp into a different time format. |
formatlist | {@link https://developer.hashicorp.com/terraform/language/functions/formatlist formatlist} produces a list of strings by formatting a number of other values according to a specification string. |
indent | {@link https://developer.hashicorp.com/terraform/language/functions/indent indent} adds a given number of spaces to the beginnings of all but the first line in a given multi-line string. |
index | {@link https://developer.hashicorp.com/terraform/language/functions/index index} finds the element index for a given value in a list. |
jsondecode | {@link https://developer.hashicorp.com/terraform/language/functions/jsondecode jsondecode} interprets a given string as JSON, returning a representation of the result of decoding that string. |
jsonencode | {@link https://developer.hashicorp.com/terraform/language/functions/jsonencode jsonencode} encodes a given value to a string using JSON syntax. |
keys | {@link https://developer.hashicorp.com/terraform/language/functions/keys keys} takes a map and returns a list containing the keys from that map. |
lengthOf | {@link https://developer.hashicorp.com/terraform/language/functions/length length} determines the length of a given list, map, or string. |
log | {@link https://developer.hashicorp.com/terraform/language/functions/log log} returns the logarithm of a given number in a given base. |
lower | {@link https://developer.hashicorp.com/terraform/language/functions/lower lower} converts all cased letters in the given string to lowercase. |
matchkeys | {@link https://developer.hashicorp.com/terraform/language/functions/matchkeys matchkeys} constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list. |
max | {@link https://developer.hashicorp.com/terraform/language/functions/max max} takes one or more numbers and returns the greatest number from the set. |
md5 | {@link https://developer.hashicorp.com/terraform/language/functions/md5 md5} computes the MD5 hash of a given string and encodes it with hexadecimal digits. |
merge | {@link https://developer.hashicorp.com/terraform/language/functions/merge merge} takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments. |
min | {@link https://developer.hashicorp.com/terraform/language/functions/min min} takes one or more numbers and returns the smallest number from the set. |
nonsensitive | {@link https://developer.hashicorp.com/terraform/language/functions/nonsensitive nonsensitive} takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value. |
one | {@link https://developer.hashicorp.com/terraform/language/functions/one one} takes a list, set, or tuple value with either zero or one elements. If the collection is empty, one returns null . Otherwise, one returns the first element. If there are two or more elements then one will return an error. |
parseint | {@link https://developer.hashicorp.com/terraform/language/functions/parseint parseint} parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive. |
pathexpand | {@link https://developer.hashicorp.com/terraform/language/functions/pathexpand pathexpand} takes a filesystem path that might begin with a ~ segment, and if so it replaces that segment with the current user's home directory path. |
plantimestamp | {@link https://developer.hashicorp.com/terraform/language/functions/plantimestamp plantimestamp} returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan. |
pow | {@link https://developer.hashicorp.com/terraform/language/functions/pow pow} calculates an exponent, by raising its first argument to the power of the second argument. |
regex | {@link https://developer.hashicorp.com/terraform/language/functions/regex regex} applies a regular expression to a string and returns the matching substrings. |
regexall | {@link https://developer.hashicorp.com/terraform/language/functions/regexall regexall} applies a regular expression to a string and returns a list of all matches. |
replace | {@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string. |
reverse | {@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. |
rsadecrypt | {@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. |
sensitive | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for sensitive input variables. |
setintersection | The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the intersection of the sets. |
setproduct | The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product. |
setsubtract | The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set. |
setunion | The {@link https://developer.hashicorp.com/terraform/language/functions/setunion setunion} function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets. |
sha1 | {@link https://developer.hashicorp.com/terraform/language/functions/sha1 sha1} computes the SHA1 hash of a given string and encodes it with hexadecimal digits. |
sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/sha256 sha256} computes the SHA256 hash of a given string and encodes it with hexadecimal digits. |
sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/sha512 sha512} computes the SHA512 hash of a given string and encodes it with hexadecimal digits. |
signum | {@link https://developer.hashicorp.com/terraform/language/functions/signum signum} determines the sign of a number, returning a number between -1 and 1 to represent the sign. |
slice | {@link https://developer.hashicorp.com/terraform/language/functions/slice slice} extracts some consecutive elements from within a list. |
sort | {@link https://developer.hashicorp.com/terraform/language/functions/sort sort} takes a list of strings and returns a new list with those strings sorted lexicographically. |
split | {@link https://developer.hashicorp.com/terraform/language/functions/split split} produces a list by dividing a given string at all occurrences of a given separator. |
startswith | {@link https://developer.hashicorp.com/terraform/language/functions/startswith startswith} takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix. |
strcontains | {@link https://developer.hashicorp.com/terraform/language/functions/strcontains strcontains} takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it. |
strrev | {@link https://developer.hashicorp.com/terraform/language/functions/strrev strrev} reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected). |
substr | {@link https://developer.hashicorp.com/terraform/language/functions/substr substr} extracts a substring from a given string by offset and (maximum) length. |
sum | {@link https://developer.hashicorp.com/terraform/language/functions/sum sum} takes a list or set of numbers and returns the sum of those numbers. |
templatefile | {@link https://developer.hashicorp.com/terraform/language/functions/templatefile templatefile} reads the file at the given path and renders its content as a template using a supplied set of template variables. |
textdecodebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/textdecodebase64 textdecodebase64} function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding. |
textencodebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/textencodebase64 textencodebase64} encodes the unicode characters in a given string using a specified character encoding, returning the result base64 encoded because Terraform language strings are always sequences of unicode characters. |
timeadd | {@link https://developer.hashicorp.com/terraform/language/functions/timeadd timeadd} adds a duration to a timestamp, returning a new timestamp. |
timecmp | {@link https://developer.hashicorp.com/terraform/language/functions/timecmp timecmp} compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent. |
timestamp | {@link https://developer.hashicorp.com/terraform/language/functions/timestamp timestamp} returns a UTC timestamp string in RFC 3339 format. |
title | {@link https://developer.hashicorp.com/terraform/language/functions/title title} converts the first letter of each word in the given string to uppercase. |
tobool | {@link https://developer.hashicorp.com/terraform/language/functions/tobool tobool} converts its argument to a boolean value. |
tolist | {@link https://developer.hashicorp.com/terraform/language/functions/tolist tolist} converts its argument to a list value. |
tomap | {@link https://developer.hashicorp.com/terraform/language/functions/tomap tomap} converts its argument to a map value. |
tonumber | {@link https://developer.hashicorp.com/terraform/language/functions/tonumber tonumber} converts its argument to a number value. |
toset | {@link https://developer.hashicorp.com/terraform/language/functions/toset toset} converts its argument to a set value. |
tostring | {@link https://developer.hashicorp.com/terraform/language/functions/tostring tostring} converts its argument to a string value. |
transpose | {@link https://developer.hashicorp.com/terraform/language/functions/transpose transpose} takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings. |
trim | {@link https://developer.hashicorp.com/terraform/language/functions/trim trim} removes the specified set of characters from the start and end of the given string. |
trimprefix | {@link https://developer.hashicorp.com/terraform/language/functions/trimprefix trimprefix} removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged. |
trimspace | {@link https://developer.hashicorp.com/terraform/language/functions/trimspace trimspace} removes any space characters from the start and end of the given string. |
trimsuffix | {@link https://developer.hashicorp.com/terraform/language/functions/trimsuffix trimsuffix} removes the specified suffix from the end of the given string. |
try | {@link https://developer.hashicorp.com/terraform/language/functions/try try} evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors. |
upper | {@link https://developer.hashicorp.com/terraform/language/functions/upper upper} converts all cased letters in the given string to uppercase. |
urlencode | {@link https://developer.hashicorp.com/terraform/language/functions/urlencode urlencode} applies URL encoding to a given string. |
uuid | {@link https://developer.hashicorp.com/terraform/language/functions/uuid uuid} generates a unique identifier string. |
uuidv5 | {@link https://developer.hashicorp.com/terraform/language/functions/uuidv5 uuidv5} generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a "version 5" UUID. |
values | {@link https://developer.hashicorp.com/terraform/language/functions/values values} takes a map and returns a list containing the values of the elements in that map. |
yamldecode | {@link https://developer.hashicorp.com/terraform/language/functions/yamldecode yamldecode} parses a string as a subset of YAML, and produces a representation of its value. |
yamlencode | {@link https://developer.hashicorp.com/terraform/language/functions/yamlencode yamlencode} encodes a given value to a string using YAML 1.2 block syntax. |
zipmap | {@link https://developer.hashicorp.com/terraform/language/functions/zipmap zipmap} constructs a map from a list of keys and a corresponding list of values. |
bcrypt | {@link /terraform/docs/language/functions/bcrypt.html bcrypt} computes a hash of the given string using the Blowfish cipher, returning a string in the Modular Crypt Format usually expected in the shadow password file on many Unix systems. |
conditional | {@link https://developer.hashicorp.com/terraform/language/expressions/conditionals} A conditional expression uses the value of a boolean expression to select one of two values. |
join | {@link /terraform/docs/language/functions/join.html join} produces a string by concatenating together all elements of a given list of strings with the given delimiter. |
lookup | {@link /terraform/docs/language/functions/lookup.html lookup} retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead. |
lookupNested | returns a property access expression that accesses the property at the given path in the given inputMap. |
range | {@link /terraform/docs/language/functions/range.html range} generates a list of numbers using a start value, a limit value, and a step value. |
rawString | Use this function to wrap a string and escape it properly for the use in Terraform This is only needed in certain scenarios (e.g., if you have unescaped double quotes in the string). |
abs
import { Fn } from 'cdktf'
Fn.abs(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/abs abs} returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it.
num
Required
- Type: number
abspath
import { Fn } from 'cdktf'
Fn.abspath(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/abspath abspath} takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory.
path
Required
- Type: string
alltrue
import { Fn } from 'cdktf'
Fn.alltrue(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/alltrue alltrue} returns true
if all elements in a given collection are true
or "true"
. It also returns true
if the collection is empty.
list
Required
- Type: any[]
anytrue
import { Fn } from 'cdktf'
Fn.anytrue(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/anytrue anytrue} returns true
if any element in a given collection is true
or "true"
. It also returns false
if the collection is empty.
list
Required
- Type: any[]
base64decode
import { Fn } from 'cdktf'
Fn.base64decode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64decode base64decode} takes a string containing a Base64 character sequence and returns the original string.
str
Required
- Type: string
base64encode
import { Fn } from 'cdktf'
Fn.base64encode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64encode base64encode} applies Base64 encoding to a string.
str
Required
- Type: string
base64gzip
import { Fn } from 'cdktf'
Fn.base64gzip(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64gzip base64gzip} compresses a string with gzip and then encodes the result in Base64 encoding.
str
Required
- Type: string
base64sha256
import { Fn } from 'cdktf'
Fn.base64sha256(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64sha256 base64sha256} computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test"))
since sha256()
returns hexadecimal representation.
str
Required
- Type: string
base64sha512
import { Fn } from 'cdktf'
Fn.base64sha512(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64sha512 base64sha512} computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test"))
since sha512()
returns hexadecimal representation.
str
Required
- Type: string
basename
import { Fn } from 'cdktf'
Fn.basename(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/basename basename} takes a string containing a filesystem path and removes all except the last portion from it.
path
Required
- Type: string
can
import { Fn } from 'cdktf'
Fn.can(expression: any)
{@link https://developer.hashicorp.com/terraform/language/functions/can can} evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.
expression
Required
- Type: any
ceil
import { Fn } from 'cdktf'
Fn.ceil(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/ceil ceil} returns the closest whole number that is greater than or equal to the given value, which may be a fraction.
num
Required
- Type: number
chomp
import { Fn } from 'cdktf'
Fn.chomp(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/chomp chomp} removes newline characters at the end of a string.
str
Required
- Type: string
chunklist
import { Fn } from 'cdktf'
Fn.chunklist(list: any[], size: number)
{@link https://developer.hashicorp.com/terraform/language/functions/chunklist chunklist} splits a single list into fixed-size chunks, returning a list of lists.
list
Required
- Type: any[]
size
Required
- Type: number
cidrhost
import { Fn } from 'cdktf'
Fn.cidrhost(prefix: string, hostnum: number)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrhost cidrhost} calculates a full host IP address for a given host number within a given IP network address prefix.
prefix
Required
- Type: string
hostnum
Required
- Type: number
cidrnetmask
import { Fn } from 'cdktf'
Fn.cidrnetmask(prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrnetmask cidrnetmask} converts an IPv4 address prefix given in CIDR notation into a subnet mask address.
prefix
Required
- Type: string
cidrsubnet
import { Fn } from 'cdktf'
Fn.cidrsubnet(prefix: string, newbits: number, netnum: number)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnet cidrsubnet} calculates a subnet address within given IP network address prefix.
prefix
Required
- Type: string
newbits
Required
- Type: number
netnum
Required
- Type: number
cidrsubnets
import { Fn } from 'cdktf'
Fn.cidrsubnets(prefix: string, newbits: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnets cidrsubnets} calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.
prefix
Required
- Type: string
newbits
Required
- Type: number[]
coalesce
import { Fn } from 'cdktf'
Fn.coalesce(vals: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/coalesce coalesce} takes any number of arguments and returns the first one that isn't null or an empty string.
vals
Required
- Type: any[]
coalescelist
import { Fn } from 'cdktf'
Fn.coalescelist(vals: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/coalescelist coalescelist} takes any number of list arguments and returns the first one that isn't empty.
vals
Required
- Type: any[]
compact
import { Fn } from 'cdktf'
Fn.compact(list: string[])
{@link https://developer.hashicorp.com/terraform/language/functions/compact compact} takes a list of strings and returns a new list with any empty string elements removed.
list
Required
- Type: string[]
concat
import { Fn } from 'cdktf'
Fn.concat(seqs: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/concat concat} takes two or more lists and combines them into a single list.
seqs
Required
- Type: any[]
contains
import { Fn } from 'cdktf'
Fn.contains(list: any, value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/contains contains} determines whether a given list or set contains a given single value as one of its elements.
list
Required
- Type: any
value
Required
- Type: any
csvdecode
import { Fn } from 'cdktf'
Fn.csvdecode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/csvdecode csvdecode} decodes a string containing CSV-formatted data and produces a list of maps representing that data.
str
Required
- Type: string
dirname
import { Fn } from 'cdktf'
Fn.dirname(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/dirname dirname} takes a string containing a filesystem path and removes the last portion from it.
path
Required
- Type: string
distinct
import { Fn } from 'cdktf'
Fn.distinct(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/distinct distinct} takes a list and returns a new list with any duplicate elements removed.
list
Required
- Type: any[]
element
import { Fn } from 'cdktf'
Fn.element(list: any, index: number)
{@link https://developer.hashicorp.com/terraform/language/functions/element element} retrieves a single element from a list.
list
Required
- Type: any
index
Required
- Type: number
endswith
import { Fn } from 'cdktf'
Fn.endswith(str: string, suffix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/endswith endswith} takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix.
str
Required
- Type: string
suffix
Required
- Type: string
file
import { Fn } from 'cdktf'
Fn.file(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/file file} reads the contents of a file at the given path and returns them as a string.
path
Required
- Type: string
filebase64
import { Fn } from 'cdktf'
Fn.filebase64(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64 filebase64} reads the contents of a file at the given path and returns them as a base64-encoded string.
path
Required
- Type: string
filebase64sha256
import { Fn } from 'cdktf'
Fn.filebase64sha256(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha256 filebase64sha256} is a variant of base64sha256
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filebase64sha512
import { Fn } from 'cdktf'
Fn.filebase64sha512(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha512 filebase64sha512} is a variant of base64sha512
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
fileexists
import { Fn } from 'cdktf'
Fn.fileexists(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/fileexists fileexists} determines whether a file exists at a given path.
path
Required
- Type: string
filemd5
import { Fn } from 'cdktf'
Fn.filemd5(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filemd5 filemd5} is a variant of md5
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
fileset
import { Fn } from 'cdktf'
Fn.fileset(path: string, pattern: string)
{@link https://developer.hashicorp.com/terraform/language/functions/fileset fileset} enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (/
) as the path separator for cross-system compatibility.
path
Required
- Type: string
pattern
Required
- Type: string
filesha1
import { Fn } from 'cdktf'
Fn.filesha1(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha1 filesha1} is a variant of sha1
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filesha256
import { Fn } from 'cdktf'
Fn.filesha256(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha256 filesha256} is a variant of sha256
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filesha512
import { Fn } from 'cdktf'
Fn.filesha512(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha512 filesha512} is a variant of sha512
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
flatten
import { Fn } from 'cdktf'
Fn.flatten(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/flatten flatten} takes a list and replaces any elements that are lists with a flattened sequence of the list contents.
list
Required
- Type: any
floor
import { Fn } from 'cdktf'
Fn.floor(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/floor floor} returns the closest whole number that is less than or equal to the given value, which may be a fraction.
num
Required
- Type: number
format
import { Fn } from 'cdktf'
Fn.format(format: string, args: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/format format} function produces a string by formatting a number of other values according to a specification string. It is similar to the printf
function in C, and other similar functions in other programming languages.
format
Required
- Type: string
args
Required
- Type: any[]
formatdate
import { Fn } from 'cdktf'
Fn.formatdate(format: string, time: string)
{@link https://developer.hashicorp.com/terraform/language/functions/formatdate formatdate} converts a timestamp into a different time format.
format
Required
- Type: string
time
Required
- Type: string
formatlist
import { Fn } from 'cdktf'
Fn.formatlist(format: string, args: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/formatlist formatlist} produces a list of strings by formatting a number of other values according to a specification string.
format
Required
- Type: string
args
Required
- Type: any[]
indent
import { Fn } from 'cdktf'
Fn.indent(spaces: number, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/indent indent} adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
spaces
Required
- Type: number
str
Required
- Type: string
index
import { Fn } from 'cdktf'
Fn.index(list: any, value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/index index} finds the element index for a given value in a list.
list
Required
- Type: any
value
Required
- Type: any
jsondecode
import { Fn } from 'cdktf'
Fn.jsondecode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/jsondecode jsondecode} interprets a given string as JSON, returning a representation of the result of decoding that string.
str
Required
- Type: string
jsonencode
import { Fn } from 'cdktf'
Fn.jsonencode(val: any)
{@link https://developer.hashicorp.com/terraform/language/functions/jsonencode jsonencode} encodes a given value to a string using JSON syntax.
val
Required
- Type: any
keys
import { Fn } from 'cdktf'
Fn.keys(inputMap: any)
{@link https://developer.hashicorp.com/terraform/language/functions/keys keys} takes a map and returns a list containing the keys from that map.
inputMap
Required
- Type: any
lengthOf
import { Fn } from 'cdktf'
Fn.lengthOf(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/length length} determines the length of a given list, map, or string.
value
Required
- Type: any
log
import { Fn } from 'cdktf'
Fn.log(num: number, base: number)
{@link https://developer.hashicorp.com/terraform/language/functions/log log} returns the logarithm of a given number in a given base.
num
Required
- Type: number
base
Required
- Type: number
lower
import { Fn } from 'cdktf'
Fn.lower(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/lower lower} converts all cased letters in the given string to lowercase.
str
Required
- Type: string
matchkeys
import { Fn } from 'cdktf'
Fn.matchkeys(values: any[], keys: any[], searchset: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/matchkeys matchkeys} constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
values
Required
- Type: any[]
keys
Required
- Type: any[]
searchset
Required
- Type: any[]
max
import { Fn } from 'cdktf'
Fn.max(numbers: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/max max} takes one or more numbers and returns the greatest number from the set.
numbers
Required
- Type: number[]
md5
import { Fn } from 'cdktf'
Fn.md5(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/md5 md5} computes the MD5 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
merge
import { Fn } from 'cdktf'
Fn.merge(maps: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/merge merge} takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments.
maps
Required
- Type: any[]
min
import { Fn } from 'cdktf'
Fn.min(numbers: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/min min} takes one or more numbers and returns the smallest number from the set.
numbers
Required
- Type: number[]
nonsensitive
import { Fn } from 'cdktf'
Fn.nonsensitive(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/nonsensitive nonsensitive} takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.
value
Required
- Type: any
one
import { Fn } from 'cdktf'
Fn.one(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/one one} takes a list, set, or tuple value with either zero or one elements. If the collection is empty, one
returns null
. Otherwise, one
returns the first element. If there are two or more elements then one
will return an error.
list
Required
- Type: any
parseint
import { Fn } from 'cdktf'
Fn.parseint(number: any, base: number)
{@link https://developer.hashicorp.com/terraform/language/functions/parseint parseint} parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive.
number
Required
- Type: any
base
Required
- Type: number
pathexpand
import { Fn } from 'cdktf'
Fn.pathexpand(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/pathexpand pathexpand} takes a filesystem path that might begin with a ~
segment, and if so it replaces that segment with the current user's home directory path.
path
Required
- Type: string
plantimestamp
import { Fn } from "cdktf";
Fn.plantimestamp();
{@link https://developer.hashicorp.com/terraform/language/functions/plantimestamp plantimestamp} returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan.
pow
import { Fn } from 'cdktf'
Fn.pow(num: number, power: number)
{@link https://developer.hashicorp.com/terraform/language/functions/pow pow} calculates an exponent, by raising its first argument to the power of the second argument.
num
Required
- Type: number
power
Required
- Type: number
regex
import { Fn } from 'cdktf'
Fn.regex(pattern: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/regex regex} applies a regular expression to a string and returns the matching substrings.
pattern
Required
- Type: string
str
Required
- Type: string
regexall
import { Fn } from 'cdktf'
Fn.regexall(pattern: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/regexall regexall} applies a regular expression to a string and returns a list of all matches.
pattern
Required
- Type: string
str
Required
- Type: string
replace
import { Fn } from 'cdktf'
Fn.replace(str: string, substr: string, replace: string)
{@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string.
str
Required
- Type: string
substr
Required
- Type: string
replace
Required
- Type: string
reverse
import { Fn } from 'cdktf'
Fn.reverse(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order.
list
Required
- Type: any
rsadecrypt
import { Fn } from 'cdktf'
Fn.rsadecrypt(ciphertext: string, privatekey: string)
{@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.
ciphertext
Required
- Type: string
privatekey
Required
- Type: string
sensitive
import { Fn } from 'cdktf'
Fn.sensitive(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for sensitive input variables.
value
Required
- Type: any
setintersection
import { Fn } from 'cdktf'
Fn.setintersection(first_set: any[], other_sets: any[][])
The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the intersection of the sets.
first_set
Required
- Type: any[]
other_sets
Required
- Type: any[][]
setproduct
import { Fn } from 'cdktf'
Fn.setproduct(sets: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product.
sets
Required
- Type: any[]
setsubtract
import { Fn } from 'cdktf'
Fn.setsubtract(a: any[], b: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set.
a
Required
- Type: any[]
b
Required
- Type: any[]
setunion
import { Fn } from 'cdktf'
Fn.setunion(first_set: any[], other_sets: any[][])
The {@link https://developer.hashicorp.com/terraform/language/functions/setunion setunion} function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets.
first_set
Required
- Type: any[]
other_sets
Required
- Type: any[][]
sha1
import { Fn } from 'cdktf'
Fn.sha1(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha1 sha1} computes the SHA1 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
sha256
import { Fn } from 'cdktf'
Fn.sha256(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha256 sha256} computes the SHA256 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
sha512
import { Fn } from 'cdktf'
Fn.sha512(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha512 sha512} computes the SHA512 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
signum
import { Fn } from 'cdktf'
Fn.signum(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/signum signum} determines the sign of a number, returning a number between -1 and 1 to represent the sign.
num
Required
- Type: number
slice
import { Fn } from 'cdktf'
Fn.slice(list: any, start_index: number, end_index: number)
{@link https://developer.hashicorp.com/terraform/language/functions/slice slice} extracts some consecutive elements from within a list.
list
Required
- Type: any
start_index
Required
- Type: number
end_index
Required
- Type: number
sort
import { Fn } from 'cdktf'
Fn.sort(list: string[])
{@link https://developer.hashicorp.com/terraform/language/functions/sort sort} takes a list of strings and returns a new list with those strings sorted lexicographically.
list
Required
- Type: string[]
split
import { Fn } from 'cdktf'
Fn.split(separator: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/split split} produces a list by dividing a given string at all occurrences of a given separator.
separator
Required
- Type: string
str
Required
- Type: string
startswith
import { Fn } from 'cdktf'
Fn.startswith(str: string, prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/startswith startswith} takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.
str
Required
- Type: string
prefix
Required
- Type: string
strcontains
import { Fn } from 'cdktf'
Fn.strcontains(str: string, substr: string)
{@link https://developer.hashicorp.com/terraform/language/functions/strcontains strcontains} takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it.
str
Required
- Type: string
substr
Required
- Type: string
strrev
import { Fn } from 'cdktf'
Fn.strrev(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/strrev strrev} reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected).
str
Required
- Type: string
substr
import { Fn } from 'cdktf'
Fn.substr(str: string, offset: number, length: number)
{@link https://developer.hashicorp.com/terraform/language/functions/substr substr} extracts a substring from a given string by offset and (maximum) length.
str
Required
- Type: string
offset
Required
- Type: number
length
Required
- Type: number
sum
import { Fn } from 'cdktf'
Fn.sum(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/sum sum} takes a list or set of numbers and returns the sum of those numbers.
list
Required
- Type: any
templatefile
import { Fn } from 'cdktf'
Fn.templatefile(path: string, vars: any)
{@link https://developer.hashicorp.com/terraform/language/functions/templatefile templatefile} reads the file at the given path and renders its content as a template using a supplied set of template variables.
path
Required
- Type: string
vars
Required
- Type: any
textdecodebase64
import { Fn } from 'cdktf'
Fn.textdecodebase64(source: string, encoding: string)
{@link https://developer.hashicorp.com/terraform/language/functions/textdecodebase64 textdecodebase64} function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.
source
Required
- Type: string
encoding
Required
- Type: string
textencodebase64
import { Fn } from 'cdktf'
Fn.textencodebase64(str: string, encoding: string)
{@link https://developer.hashicorp.com/terraform/language/functions/textencodebase64 textencodebase64} encodes the unicode characters in a given string using a specified character encoding, returning the result base64 encoded because Terraform language strings are always sequences of unicode characters.
str
Required
- Type: string
encoding
Required
- Type: string
timeadd
import { Fn } from 'cdktf'
Fn.timeadd(timestamp: string, duration: string)
{@link https://developer.hashicorp.com/terraform/language/functions/timeadd timeadd} adds a duration to a timestamp, returning a new timestamp.
timestamp
Required
- Type: string
duration
Required
- Type: string
timecmp
import { Fn } from 'cdktf'
Fn.timecmp(timestamp_a: string, timestamp_b: string)
{@link https://developer.hashicorp.com/terraform/language/functions/timecmp timecmp} compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.
timestamp_a
Required
- Type: string
timestamp_b
Required
- Type: string
timestamp
import { Fn } from "cdktf";
Fn.timestamp();
{@link https://developer.hashicorp.com/terraform/language/functions/timestamp timestamp} returns a UTC timestamp string in RFC 3339 format.
title
import { Fn } from 'cdktf'
Fn.title(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/title title} converts the first letter of each word in the given string to uppercase.
str
Required
- Type: string
tobool
import { Fn } from 'cdktf'
Fn.tobool(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tobool tobool} converts its argument to a boolean value.
v
Required
- Type: any
tolist
import { Fn } from 'cdktf'
Fn.tolist(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tolist tolist} converts its argument to a list value.
v
Required
- Type: any
tomap
import { Fn } from 'cdktf'
Fn.tomap(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tomap tomap} converts its argument to a map value.
v
Required
- Type: any
tonumber
import { Fn } from 'cdktf'
Fn.tonumber(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tonumber tonumber} converts its argument to a number value.
v
Required
- Type: any
toset
import { Fn } from 'cdktf'
Fn.toset(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/toset toset} converts its argument to a set value.
v
Required
- Type: any
tostring
import { Fn } from 'cdktf'
Fn.tostring(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tostring tostring} converts its argument to a string value.
v
Required
- Type: any
transpose
import { Fn } from 'cdktf'
Fn.transpose(values: any)
{@link https://developer.hashicorp.com/terraform/language/functions/transpose transpose} takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.
values
Required
- Type: any
trim
import { Fn } from 'cdktf'
Fn.trim(str: string, cutset: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trim trim} removes the specified set of characters from the start and end of the given string.
str
Required
- Type: string
cutset
Required
- Type: string
trimprefix
import { Fn } from 'cdktf'
Fn.trimprefix(str: string, prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimprefix trimprefix} removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged.
str
Required
- Type: string
prefix
Required
- Type: string
trimspace
import { Fn } from 'cdktf'
Fn.trimspace(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimspace trimspace} removes any space characters from the start and end of the given string.
str
Required
- Type: string
trimsuffix
import { Fn } from 'cdktf'
Fn.trimsuffix(str: string, suffix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimsuffix trimsuffix} removes the specified suffix from the end of the given string.
str
Required
- Type: string
suffix
Required
- Type: string
try
import { Fn } from 'cdktf'
Fn.try(expressions: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/try try} evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors.
expressions
Required
- Type: any[]
upper
import { Fn } from 'cdktf'
Fn.upper(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/upper upper} converts all cased letters in the given string to uppercase.
str
Required
- Type: string
urlencode
import { Fn } from 'cdktf'
Fn.urlencode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/urlencode urlencode} applies URL encoding to a given string.
str
Required
- Type: string
uuid
import { Fn } from "cdktf";
Fn.uuid();
{@link https://developer.hashicorp.com/terraform/language/functions/uuid uuid} generates a unique identifier string.
uuidv5
import { Fn } from 'cdktf'
Fn.uuidv5(namespace: string, name: string)
{@link https://developer.hashicorp.com/terraform/language/functions/uuidv5 uuidv5} generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a "version 5" UUID.
namespace
Required
- Type: string
name
Required
- Type: string
values
import { Fn } from 'cdktf'
Fn.values(mapping: any)
{@link https://developer.hashicorp.com/terraform/language/functions/values values} takes a map and returns a list containing the values of the elements in that map.
mapping
Required
- Type: any
yamldecode
import { Fn } from 'cdktf'
Fn.yamldecode(src: string)
{@link https://developer.hashicorp.com/terraform/language/functions/yamldecode yamldecode} parses a string as a subset of YAML, and produces a representation of its value.
src
Required
- Type: string
yamlencode
import { Fn } from 'cdktf'
Fn.yamlencode(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/yamlencode yamlencode} encodes a given value to a string using YAML 1.2 block syntax.
value
Required
- Type: any
zipmap
import { Fn } from 'cdktf'
Fn.zipmap(keys: string[], values: any)
{@link https://developer.hashicorp.com/terraform/language/functions/zipmap zipmap} constructs a map from a list of keys and a corresponding list of values.
keys
Required
- Type: string[]
values
Required
- Type: any
bcrypt
import { Fn } from 'cdktf'
Fn.bcrypt(str: string, cost?: number)
{@link /terraform/docs/language/functions/bcrypt.html bcrypt} computes a hash of the given string using the Blowfish cipher, returning a string in the Modular Crypt Format usually expected in the shadow password file on many Unix systems.
str
Required
- Type: string
cost
Optional
- Type: number
conditional
import { Fn } from 'cdktf'
Fn.conditional(condition: any, trueValue: any, falseValue: any)
{@link https://developer.hashicorp.com/terraform/language/expressions/conditionals} A conditional expression uses the value of a boolean expression to select one of two values.
condition
Required
- Type: any
trueValue
Required
- Type: any
falseValue
Required
- Type: any
join
import { Fn } from 'cdktf'
Fn.join(separator: string, list: string[])
{@link /terraform/docs/language/functions/join.html join} produces a string by concatenating together all elements of a given list of strings with the given delimiter.
separator
Required
- Type: string
list
Required
- Type: string[]
lookup
import { Fn } from 'cdktf'
Fn.lookup(inputMap: any, key: string, defaultValue?: any)
{@link /terraform/docs/language/functions/lookup.html lookup} retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead.
inputMap
Required
- Type: any
key
Required
- Type: string
defaultValue
Optional
- Type: any
lookupNested
import { Fn } from 'cdktf'
Fn.lookupNested(inputMap: any, path: any[])
returns a property access expression that accesses the property at the given path in the given inputMap.
For example lookupNested(x, ["a", "b", "c"]) will return a Terraform expression like x["a"]["b"]["c"]
inputMap
Required
- Type: any
path
Required
- Type: any[]
range
import { Fn } from 'cdktf'
Fn.range(start: number, limit: number, step?: number)
{@link /terraform/docs/language/functions/range.html range} generates a list of numbers using a start value, a limit value, and a step value.
start
Required
- Type: number
limit
Required
- Type: number
step
Optional
- Type: number
rawString
import { Fn } from 'cdktf'
Fn.rawString(str: string)
Use this function to wrap a string and escape it properly for the use in Terraform This is only needed in certain scenarios (e.g., if you have unescaped double quotes in the string).
str
Required
- Type: string
FnGenerated
Initializers
import { FnGenerated } from "cdktf";
new FnGenerated();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
abs | {@link https://developer.hashicorp.com/terraform/language/functions/abs abs} returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it. |
abspath | {@link https://developer.hashicorp.com/terraform/language/functions/abspath abspath} takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory. |
alltrue | {@link https://developer.hashicorp.com/terraform/language/functions/alltrue alltrue} returns true if all elements in a given collection are true or "true" . It also returns true if the collection is empty. |
anytrue | {@link https://developer.hashicorp.com/terraform/language/functions/anytrue anytrue} returns true if any element in a given collection is true or "true" . It also returns false if the collection is empty. |
base64decode | {@link https://developer.hashicorp.com/terraform/language/functions/base64decode base64decode} takes a string containing a Base64 character sequence and returns the original string. |
base64encode | {@link https://developer.hashicorp.com/terraform/language/functions/base64encode base64encode} applies Base64 encoding to a string. |
base64gzip | {@link https://developer.hashicorp.com/terraform/language/functions/base64gzip base64gzip} compresses a string with gzip and then encodes the result in Base64 encoding. |
base64sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha256 base64sha256} computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test")) since sha256() returns hexadecimal representation. |
base64sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha512 base64sha512} computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test")) since sha512() returns hexadecimal representation. |
basename | {@link https://developer.hashicorp.com/terraform/language/functions/basename basename} takes a string containing a filesystem path and removes all except the last portion from it. |
can | {@link https://developer.hashicorp.com/terraform/language/functions/can can} evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors. |
ceil | {@link https://developer.hashicorp.com/terraform/language/functions/ceil ceil} returns the closest whole number that is greater than or equal to the given value, which may be a fraction. |
chomp | {@link https://developer.hashicorp.com/terraform/language/functions/chomp chomp} removes newline characters at the end of a string. |
chunklist | {@link https://developer.hashicorp.com/terraform/language/functions/chunklist chunklist} splits a single list into fixed-size chunks, returning a list of lists. |
cidrhost | {@link https://developer.hashicorp.com/terraform/language/functions/cidrhost cidrhost} calculates a full host IP address for a given host number within a given IP network address prefix. |
cidrnetmask | {@link https://developer.hashicorp.com/terraform/language/functions/cidrnetmask cidrnetmask} converts an IPv4 address prefix given in CIDR notation into a subnet mask address. |
cidrsubnet | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnet cidrsubnet} calculates a subnet address within given IP network address prefix. |
cidrsubnets | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnets cidrsubnets} calculates a sequence of consecutive IP address ranges within a particular CIDR prefix. |
coalesce | {@link https://developer.hashicorp.com/terraform/language/functions/coalesce coalesce} takes any number of arguments and returns the first one that isn't null or an empty string. |
coalescelist | {@link https://developer.hashicorp.com/terraform/language/functions/coalescelist coalescelist} takes any number of list arguments and returns the first one that isn't empty. |
compact | {@link https://developer.hashicorp.com/terraform/language/functions/compact compact} takes a list of strings and returns a new list with any empty string elements removed. |
concat | {@link https://developer.hashicorp.com/terraform/language/functions/concat concat} takes two or more lists and combines them into a single list. |
contains | {@link https://developer.hashicorp.com/terraform/language/functions/contains contains} determines whether a given list or set contains a given single value as one of its elements. |
csvdecode | {@link https://developer.hashicorp.com/terraform/language/functions/csvdecode csvdecode} decodes a string containing CSV-formatted data and produces a list of maps representing that data. |
dirname | {@link https://developer.hashicorp.com/terraform/language/functions/dirname dirname} takes a string containing a filesystem path and removes the last portion from it. |
distinct | {@link https://developer.hashicorp.com/terraform/language/functions/distinct distinct} takes a list and returns a new list with any duplicate elements removed. |
element | {@link https://developer.hashicorp.com/terraform/language/functions/element element} retrieves a single element from a list. |
endswith | {@link https://developer.hashicorp.com/terraform/language/functions/endswith endswith} takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix. |
file | {@link https://developer.hashicorp.com/terraform/language/functions/file file} reads the contents of a file at the given path and returns them as a string. |
filebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64 filebase64} reads the contents of a file at the given path and returns them as a base64-encoded string. |
filebase64sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha256 filebase64sha256} is a variant of base64sha256 that hashes the contents of a given file rather than a literal string. |
filebase64sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha512 filebase64sha512} is a variant of base64sha512 that hashes the contents of a given file rather than a literal string. |
fileexists | {@link https://developer.hashicorp.com/terraform/language/functions/fileexists fileexists} determines whether a file exists at a given path. |
filemd5 | {@link https://developer.hashicorp.com/terraform/language/functions/filemd5 filemd5} is a variant of md5 that hashes the contents of a given file rather than a literal string. |
fileset | {@link https://developer.hashicorp.com/terraform/language/functions/fileset fileset} enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (/ ) as the path separator for cross-system compatibility. |
filesha1 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha1 filesha1} is a variant of sha1 that hashes the contents of a given file rather than a literal string. |
filesha256 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha256 filesha256} is a variant of sha256 that hashes the contents of a given file rather than a literal string. |
filesha512 | {@link https://developer.hashicorp.com/terraform/language/functions/filesha512 filesha512} is a variant of sha512 that hashes the contents of a given file rather than a literal string. |
flatten | {@link https://developer.hashicorp.com/terraform/language/functions/flatten flatten} takes a list and replaces any elements that are lists with a flattened sequence of the list contents. |
floor | {@link https://developer.hashicorp.com/terraform/language/functions/floor floor} returns the closest whole number that is less than or equal to the given value, which may be a fraction. |
format | The {@link https://developer.hashicorp.com/terraform/language/functions/format format} function produces a string by formatting a number of other values according to a specification string. It is similar to the printf function in C, and other similar functions in other programming languages. |
formatdate | {@link https://developer.hashicorp.com/terraform/language/functions/formatdate formatdate} converts a timestamp into a different time format. |
formatlist | {@link https://developer.hashicorp.com/terraform/language/functions/formatlist formatlist} produces a list of strings by formatting a number of other values according to a specification string. |
indent | {@link https://developer.hashicorp.com/terraform/language/functions/indent indent} adds a given number of spaces to the beginnings of all but the first line in a given multi-line string. |
index | {@link https://developer.hashicorp.com/terraform/language/functions/index index} finds the element index for a given value in a list. |
jsondecode | {@link https://developer.hashicorp.com/terraform/language/functions/jsondecode jsondecode} interprets a given string as JSON, returning a representation of the result of decoding that string. |
jsonencode | {@link https://developer.hashicorp.com/terraform/language/functions/jsonencode jsonencode} encodes a given value to a string using JSON syntax. |
keys | {@link https://developer.hashicorp.com/terraform/language/functions/keys keys} takes a map and returns a list containing the keys from that map. |
lengthOf | {@link https://developer.hashicorp.com/terraform/language/functions/length length} determines the length of a given list, map, or string. |
log | {@link https://developer.hashicorp.com/terraform/language/functions/log log} returns the logarithm of a given number in a given base. |
lower | {@link https://developer.hashicorp.com/terraform/language/functions/lower lower} converts all cased letters in the given string to lowercase. |
matchkeys | {@link https://developer.hashicorp.com/terraform/language/functions/matchkeys matchkeys} constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list. |
max | {@link https://developer.hashicorp.com/terraform/language/functions/max max} takes one or more numbers and returns the greatest number from the set. |
md5 | {@link https://developer.hashicorp.com/terraform/language/functions/md5 md5} computes the MD5 hash of a given string and encodes it with hexadecimal digits. |
merge | {@link https://developer.hashicorp.com/terraform/language/functions/merge merge} takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments. |
min | {@link https://developer.hashicorp.com/terraform/language/functions/min min} takes one or more numbers and returns the smallest number from the set. |
nonsensitive | {@link https://developer.hashicorp.com/terraform/language/functions/nonsensitive nonsensitive} takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value. |
one | {@link https://developer.hashicorp.com/terraform/language/functions/one one} takes a list, set, or tuple value with either zero or one elements. If the collection is empty, one returns null . Otherwise, one returns the first element. If there are two or more elements then one will return an error. |
parseint | {@link https://developer.hashicorp.com/terraform/language/functions/parseint parseint} parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive. |
pathexpand | {@link https://developer.hashicorp.com/terraform/language/functions/pathexpand pathexpand} takes a filesystem path that might begin with a ~ segment, and if so it replaces that segment with the current user's home directory path. |
plantimestamp | {@link https://developer.hashicorp.com/terraform/language/functions/plantimestamp plantimestamp} returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan. |
pow | {@link https://developer.hashicorp.com/terraform/language/functions/pow pow} calculates an exponent, by raising its first argument to the power of the second argument. |
regex | {@link https://developer.hashicorp.com/terraform/language/functions/regex regex} applies a regular expression to a string and returns the matching substrings. |
regexall | {@link https://developer.hashicorp.com/terraform/language/functions/regexall regexall} applies a regular expression to a string and returns a list of all matches. |
replace | {@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string. |
reverse | {@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. |
rsadecrypt | {@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. |
sensitive | {@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for sensitive input variables. |
setintersection | The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the intersection of the sets. |
setproduct | The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product. |
setsubtract | The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set. |
setunion | The {@link https://developer.hashicorp.com/terraform/language/functions/setunion setunion} function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets. |
sha1 | {@link https://developer.hashicorp.com/terraform/language/functions/sha1 sha1} computes the SHA1 hash of a given string and encodes it with hexadecimal digits. |
sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/sha256 sha256} computes the SHA256 hash of a given string and encodes it with hexadecimal digits. |
sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/sha512 sha512} computes the SHA512 hash of a given string and encodes it with hexadecimal digits. |
signum | {@link https://developer.hashicorp.com/terraform/language/functions/signum signum} determines the sign of a number, returning a number between -1 and 1 to represent the sign. |
slice | {@link https://developer.hashicorp.com/terraform/language/functions/slice slice} extracts some consecutive elements from within a list. |
sort | {@link https://developer.hashicorp.com/terraform/language/functions/sort sort} takes a list of strings and returns a new list with those strings sorted lexicographically. |
split | {@link https://developer.hashicorp.com/terraform/language/functions/split split} produces a list by dividing a given string at all occurrences of a given separator. |
startswith | {@link https://developer.hashicorp.com/terraform/language/functions/startswith startswith} takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix. |
strcontains | {@link https://developer.hashicorp.com/terraform/language/functions/strcontains strcontains} takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it. |
strrev | {@link https://developer.hashicorp.com/terraform/language/functions/strrev strrev} reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected). |
substr | {@link https://developer.hashicorp.com/terraform/language/functions/substr substr} extracts a substring from a given string by offset and (maximum) length. |
sum | {@link https://developer.hashicorp.com/terraform/language/functions/sum sum} takes a list or set of numbers and returns the sum of those numbers. |
templatefile | {@link https://developer.hashicorp.com/terraform/language/functions/templatefile templatefile} reads the file at the given path and renders its content as a template using a supplied set of template variables. |
textdecodebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/textdecodebase64 textdecodebase64} function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding. |
textencodebase64 | {@link https://developer.hashicorp.com/terraform/language/functions/textencodebase64 textencodebase64} encodes the unicode characters in a given string using a specified character encoding, returning the result base64 encoded because Terraform language strings are always sequences of unicode characters. |
timeadd | {@link https://developer.hashicorp.com/terraform/language/functions/timeadd timeadd} adds a duration to a timestamp, returning a new timestamp. |
timecmp | {@link https://developer.hashicorp.com/terraform/language/functions/timecmp timecmp} compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent. |
timestamp | {@link https://developer.hashicorp.com/terraform/language/functions/timestamp timestamp} returns a UTC timestamp string in RFC 3339 format. |
title | {@link https://developer.hashicorp.com/terraform/language/functions/title title} converts the first letter of each word in the given string to uppercase. |
tobool | {@link https://developer.hashicorp.com/terraform/language/functions/tobool tobool} converts its argument to a boolean value. |
tolist | {@link https://developer.hashicorp.com/terraform/language/functions/tolist tolist} converts its argument to a list value. |
tomap | {@link https://developer.hashicorp.com/terraform/language/functions/tomap tomap} converts its argument to a map value. |
tonumber | {@link https://developer.hashicorp.com/terraform/language/functions/tonumber tonumber} converts its argument to a number value. |
toset | {@link https://developer.hashicorp.com/terraform/language/functions/toset toset} converts its argument to a set value. |
tostring | {@link https://developer.hashicorp.com/terraform/language/functions/tostring tostring} converts its argument to a string value. |
transpose | {@link https://developer.hashicorp.com/terraform/language/functions/transpose transpose} takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings. |
trim | {@link https://developer.hashicorp.com/terraform/language/functions/trim trim} removes the specified set of characters from the start and end of the given string. |
trimprefix | {@link https://developer.hashicorp.com/terraform/language/functions/trimprefix trimprefix} removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged. |
trimspace | {@link https://developer.hashicorp.com/terraform/language/functions/trimspace trimspace} removes any space characters from the start and end of the given string. |
trimsuffix | {@link https://developer.hashicorp.com/terraform/language/functions/trimsuffix trimsuffix} removes the specified suffix from the end of the given string. |
try | {@link https://developer.hashicorp.com/terraform/language/functions/try try} evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors. |
upper | {@link https://developer.hashicorp.com/terraform/language/functions/upper upper} converts all cased letters in the given string to uppercase. |
urlencode | {@link https://developer.hashicorp.com/terraform/language/functions/urlencode urlencode} applies URL encoding to a given string. |
uuid | {@link https://developer.hashicorp.com/terraform/language/functions/uuid uuid} generates a unique identifier string. |
uuidv5 | {@link https://developer.hashicorp.com/terraform/language/functions/uuidv5 uuidv5} generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a "version 5" UUID. |
values | {@link https://developer.hashicorp.com/terraform/language/functions/values values} takes a map and returns a list containing the values of the elements in that map. |
yamldecode | {@link https://developer.hashicorp.com/terraform/language/functions/yamldecode yamldecode} parses a string as a subset of YAML, and produces a representation of its value. |
yamlencode | {@link https://developer.hashicorp.com/terraform/language/functions/yamlencode yamlencode} encodes a given value to a string using YAML 1.2 block syntax. |
zipmap | {@link https://developer.hashicorp.com/terraform/language/functions/zipmap zipmap} constructs a map from a list of keys and a corresponding list of values. |
abs
import { FnGenerated } from 'cdktf'
FnGenerated.abs(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/abs abs} returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it.
num
Required
- Type: number
abspath
import { FnGenerated } from 'cdktf'
FnGenerated.abspath(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/abspath abspath} takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory.
path
Required
- Type: string
alltrue
import { FnGenerated } from 'cdktf'
FnGenerated.alltrue(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/alltrue alltrue} returns true
if all elements in a given collection are true
or "true"
. It also returns true
if the collection is empty.
list
Required
- Type: any[]
anytrue
import { FnGenerated } from 'cdktf'
FnGenerated.anytrue(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/anytrue anytrue} returns true
if any element in a given collection is true
or "true"
. It also returns false
if the collection is empty.
list
Required
- Type: any[]
base64decode
import { FnGenerated } from 'cdktf'
FnGenerated.base64decode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64decode base64decode} takes a string containing a Base64 character sequence and returns the original string.
str
Required
- Type: string
base64encode
import { FnGenerated } from 'cdktf'
FnGenerated.base64encode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64encode base64encode} applies Base64 encoding to a string.
str
Required
- Type: string
base64gzip
import { FnGenerated } from 'cdktf'
FnGenerated.base64gzip(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64gzip base64gzip} compresses a string with gzip and then encodes the result in Base64 encoding.
str
Required
- Type: string
base64sha256
import { FnGenerated } from 'cdktf'
FnGenerated.base64sha256(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64sha256 base64sha256} computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test"))
since sha256()
returns hexadecimal representation.
str
Required
- Type: string
base64sha512
import { FnGenerated } from 'cdktf'
FnGenerated.base64sha512(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/base64sha512 base64sha512} computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test"))
since sha512()
returns hexadecimal representation.
str
Required
- Type: string
basename
import { FnGenerated } from 'cdktf'
FnGenerated.basename(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/basename basename} takes a string containing a filesystem path and removes all except the last portion from it.
path
Required
- Type: string
can
import { FnGenerated } from 'cdktf'
FnGenerated.can(expression: any)
{@link https://developer.hashicorp.com/terraform/language/functions/can can} evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.
expression
Required
- Type: any
ceil
import { FnGenerated } from 'cdktf'
FnGenerated.ceil(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/ceil ceil} returns the closest whole number that is greater than or equal to the given value, which may be a fraction.
num
Required
- Type: number
chomp
import { FnGenerated } from 'cdktf'
FnGenerated.chomp(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/chomp chomp} removes newline characters at the end of a string.
str
Required
- Type: string
chunklist
import { FnGenerated } from 'cdktf'
FnGenerated.chunklist(list: any[], size: number)
{@link https://developer.hashicorp.com/terraform/language/functions/chunklist chunklist} splits a single list into fixed-size chunks, returning a list of lists.
list
Required
- Type: any[]
size
Required
- Type: number
cidrhost
import { FnGenerated } from 'cdktf'
FnGenerated.cidrhost(prefix: string, hostnum: number)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrhost cidrhost} calculates a full host IP address for a given host number within a given IP network address prefix.
prefix
Required
- Type: string
hostnum
Required
- Type: number
cidrnetmask
import { FnGenerated } from 'cdktf'
FnGenerated.cidrnetmask(prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrnetmask cidrnetmask} converts an IPv4 address prefix given in CIDR notation into a subnet mask address.
prefix
Required
- Type: string
cidrsubnet
import { FnGenerated } from 'cdktf'
FnGenerated.cidrsubnet(prefix: string, newbits: number, netnum: number)
{@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnet cidrsubnet} calculates a subnet address within given IP network address prefix.
prefix
Required
- Type: string
newbits
Required
- Type: number
netnum
Required
- Type: number
cidrsubnets
import { FnGenerated } from 'cdktf'
FnGenerated.cidrsubnets(prefix: string, newbits: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnets cidrsubnets} calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.
prefix
Required
- Type: string
newbits
Required
- Type: number[]
coalesce
import { FnGenerated } from 'cdktf'
FnGenerated.coalesce(vals: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/coalesce coalesce} takes any number of arguments and returns the first one that isn't null or an empty string.
vals
Required
- Type: any[]
coalescelist
import { FnGenerated } from 'cdktf'
FnGenerated.coalescelist(vals: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/coalescelist coalescelist} takes any number of list arguments and returns the first one that isn't empty.
vals
Required
- Type: any[]
compact
import { FnGenerated } from 'cdktf'
FnGenerated.compact(list: string[])
{@link https://developer.hashicorp.com/terraform/language/functions/compact compact} takes a list of strings and returns a new list with any empty string elements removed.
list
Required
- Type: string[]
concat
import { FnGenerated } from 'cdktf'
FnGenerated.concat(seqs: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/concat concat} takes two or more lists and combines them into a single list.
seqs
Required
- Type: any[]
contains
import { FnGenerated } from 'cdktf'
FnGenerated.contains(list: any, value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/contains contains} determines whether a given list or set contains a given single value as one of its elements.
list
Required
- Type: any
value
Required
- Type: any
csvdecode
import { FnGenerated } from 'cdktf'
FnGenerated.csvdecode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/csvdecode csvdecode} decodes a string containing CSV-formatted data and produces a list of maps representing that data.
str
Required
- Type: string
dirname
import { FnGenerated } from 'cdktf'
FnGenerated.dirname(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/dirname dirname} takes a string containing a filesystem path and removes the last portion from it.
path
Required
- Type: string
distinct
import { FnGenerated } from 'cdktf'
FnGenerated.distinct(list: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/distinct distinct} takes a list and returns a new list with any duplicate elements removed.
list
Required
- Type: any[]
element
import { FnGenerated } from 'cdktf'
FnGenerated.element(list: any, index: number)
{@link https://developer.hashicorp.com/terraform/language/functions/element element} retrieves a single element from a list.
list
Required
- Type: any
index
Required
- Type: number
endswith
import { FnGenerated } from 'cdktf'
FnGenerated.endswith(str: string, suffix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/endswith endswith} takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix.
str
Required
- Type: string
suffix
Required
- Type: string
file
import { FnGenerated } from 'cdktf'
FnGenerated.file(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/file file} reads the contents of a file at the given path and returns them as a string.
path
Required
- Type: string
filebase64
import { FnGenerated } from 'cdktf'
FnGenerated.filebase64(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64 filebase64} reads the contents of a file at the given path and returns them as a base64-encoded string.
path
Required
- Type: string
filebase64sha256
import { FnGenerated } from 'cdktf'
FnGenerated.filebase64sha256(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha256 filebase64sha256} is a variant of base64sha256
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filebase64sha512
import { FnGenerated } from 'cdktf'
FnGenerated.filebase64sha512(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filebase64sha512 filebase64sha512} is a variant of base64sha512
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
fileexists
import { FnGenerated } from 'cdktf'
FnGenerated.fileexists(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/fileexists fileexists} determines whether a file exists at a given path.
path
Required
- Type: string
filemd5
import { FnGenerated } from 'cdktf'
FnGenerated.filemd5(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filemd5 filemd5} is a variant of md5
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
fileset
import { FnGenerated } from 'cdktf'
FnGenerated.fileset(path: string, pattern: string)
{@link https://developer.hashicorp.com/terraform/language/functions/fileset fileset} enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (/
) as the path separator for cross-system compatibility.
path
Required
- Type: string
pattern
Required
- Type: string
filesha1
import { FnGenerated } from 'cdktf'
FnGenerated.filesha1(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha1 filesha1} is a variant of sha1
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filesha256
import { FnGenerated } from 'cdktf'
FnGenerated.filesha256(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha256 filesha256} is a variant of sha256
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
filesha512
import { FnGenerated } from 'cdktf'
FnGenerated.filesha512(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/filesha512 filesha512} is a variant of sha512
that hashes the contents of a given file rather than a literal string.
path
Required
- Type: string
flatten
import { FnGenerated } from 'cdktf'
FnGenerated.flatten(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/flatten flatten} takes a list and replaces any elements that are lists with a flattened sequence of the list contents.
list
Required
- Type: any
floor
import { FnGenerated } from 'cdktf'
FnGenerated.floor(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/floor floor} returns the closest whole number that is less than or equal to the given value, which may be a fraction.
num
Required
- Type: number
format
import { FnGenerated } from 'cdktf'
FnGenerated.format(format: string, args: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/format format} function produces a string by formatting a number of other values according to a specification string. It is similar to the printf
function in C, and other similar functions in other programming languages.
format
Required
- Type: string
args
Required
- Type: any[]
formatdate
import { FnGenerated } from 'cdktf'
FnGenerated.formatdate(format: string, time: string)
{@link https://developer.hashicorp.com/terraform/language/functions/formatdate formatdate} converts a timestamp into a different time format.
format
Required
- Type: string
time
Required
- Type: string
formatlist
import { FnGenerated } from 'cdktf'
FnGenerated.formatlist(format: string, args: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/formatlist formatlist} produces a list of strings by formatting a number of other values according to a specification string.
format
Required
- Type: string
args
Required
- Type: any[]
indent
import { FnGenerated } from 'cdktf'
FnGenerated.indent(spaces: number, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/indent indent} adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
spaces
Required
- Type: number
str
Required
- Type: string
index
import { FnGenerated } from 'cdktf'
FnGenerated.index(list: any, value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/index index} finds the element index for a given value in a list.
list
Required
- Type: any
value
Required
- Type: any
jsondecode
import { FnGenerated } from 'cdktf'
FnGenerated.jsondecode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/jsondecode jsondecode} interprets a given string as JSON, returning a representation of the result of decoding that string.
str
Required
- Type: string
jsonencode
import { FnGenerated } from 'cdktf'
FnGenerated.jsonencode(val: any)
{@link https://developer.hashicorp.com/terraform/language/functions/jsonencode jsonencode} encodes a given value to a string using JSON syntax.
val
Required
- Type: any
keys
import { FnGenerated } from 'cdktf'
FnGenerated.keys(inputMap: any)
{@link https://developer.hashicorp.com/terraform/language/functions/keys keys} takes a map and returns a list containing the keys from that map.
inputMap
Required
- Type: any
lengthOf
import { FnGenerated } from 'cdktf'
FnGenerated.lengthOf(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/length length} determines the length of a given list, map, or string.
value
Required
- Type: any
log
import { FnGenerated } from 'cdktf'
FnGenerated.log(num: number, base: number)
{@link https://developer.hashicorp.com/terraform/language/functions/log log} returns the logarithm of a given number in a given base.
num
Required
- Type: number
base
Required
- Type: number
lower
import { FnGenerated } from 'cdktf'
FnGenerated.lower(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/lower lower} converts all cased letters in the given string to lowercase.
str
Required
- Type: string
matchkeys
import { FnGenerated } from 'cdktf'
FnGenerated.matchkeys(values: any[], keys: any[], searchset: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/matchkeys matchkeys} constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
values
Required
- Type: any[]
keys
Required
- Type: any[]
searchset
Required
- Type: any[]
max
import { FnGenerated } from 'cdktf'
FnGenerated.max(numbers: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/max max} takes one or more numbers and returns the greatest number from the set.
numbers
Required
- Type: number[]
md5
import { FnGenerated } from 'cdktf'
FnGenerated.md5(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/md5 md5} computes the MD5 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
merge
import { FnGenerated } from 'cdktf'
FnGenerated.merge(maps: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/merge merge} takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments.
maps
Required
- Type: any[]
min
import { FnGenerated } from 'cdktf'
FnGenerated.min(numbers: number[])
{@link https://developer.hashicorp.com/terraform/language/functions/min min} takes one or more numbers and returns the smallest number from the set.
numbers
Required
- Type: number[]
nonsensitive
import { FnGenerated } from 'cdktf'
FnGenerated.nonsensitive(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/nonsensitive nonsensitive} takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.
value
Required
- Type: any
one
import { FnGenerated } from 'cdktf'
FnGenerated.one(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/one one} takes a list, set, or tuple value with either zero or one elements. If the collection is empty, one
returns null
. Otherwise, one
returns the first element. If there are two or more elements then one
will return an error.
list
Required
- Type: any
parseint
import { FnGenerated } from 'cdktf'
FnGenerated.parseint(number: any, base: number)
{@link https://developer.hashicorp.com/terraform/language/functions/parseint parseint} parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive.
number
Required
- Type: any
base
Required
- Type: number
pathexpand
import { FnGenerated } from 'cdktf'
FnGenerated.pathexpand(path: string)
{@link https://developer.hashicorp.com/terraform/language/functions/pathexpand pathexpand} takes a filesystem path that might begin with a ~
segment, and if so it replaces that segment with the current user's home directory path.
path
Required
- Type: string
plantimestamp
import { FnGenerated } from "cdktf";
FnGenerated.plantimestamp();
{@link https://developer.hashicorp.com/terraform/language/functions/plantimestamp plantimestamp} returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan.
pow
import { FnGenerated } from 'cdktf'
FnGenerated.pow(num: number, power: number)
{@link https://developer.hashicorp.com/terraform/language/functions/pow pow} calculates an exponent, by raising its first argument to the power of the second argument.
num
Required
- Type: number
power
Required
- Type: number
regex
import { FnGenerated } from 'cdktf'
FnGenerated.regex(pattern: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/regex regex} applies a regular expression to a string and returns the matching substrings.
pattern
Required
- Type: string
str
Required
- Type: string
regexall
import { FnGenerated } from 'cdktf'
FnGenerated.regexall(pattern: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/regexall regexall} applies a regular expression to a string and returns a list of all matches.
pattern
Required
- Type: string
str
Required
- Type: string
replace
import { FnGenerated } from 'cdktf'
FnGenerated.replace(str: string, substr: string, replace: string)
{@link https://developer.hashicorp.com/terraform/language/functions/replace replace} searches a given string for another given substring, and replaces each occurrence with a given replacement string.
str
Required
- Type: string
substr
Required
- Type: string
replace
Required
- Type: string
reverse
import { FnGenerated } from 'cdktf'
FnGenerated.reverse(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/reverse reverse} takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order.
list
Required
- Type: any
rsadecrypt
import { FnGenerated } from 'cdktf'
FnGenerated.rsadecrypt(ciphertext: string, privatekey: string)
{@link https://developer.hashicorp.com/terraform/language/functions/rsadecrypt rsadecrypt} decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.
ciphertext
Required
- Type: string
privatekey
Required
- Type: string
sensitive
import { FnGenerated } from 'cdktf'
FnGenerated.sensitive(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/sensitive sensitive} takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for sensitive input variables.
value
Required
- Type: any
setintersection
import { FnGenerated } from 'cdktf'
FnGenerated.setintersection(first_set: any[], other_sets: any[][])
The {@link https://developer.hashicorp.com/terraform/language/functions/setintersection setintersection} function takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the intersection of the sets.
first_set
Required
- Type: any[]
other_sets
Required
- Type: any[][]
setproduct
import { FnGenerated } from 'cdktf'
FnGenerated.setproduct(sets: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/setproduct setproduct} function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product.
sets
Required
- Type: any[]
setsubtract
import { FnGenerated } from 'cdktf'
FnGenerated.setsubtract(a: any[], b: any[])
The {@link https://developer.hashicorp.com/terraform/language/functions/setsubtract setsubtract} function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set.
a
Required
- Type: any[]
b
Required
- Type: any[]
setunion
import { FnGenerated } from 'cdktf'
FnGenerated.setunion(first_set: any[], other_sets: any[][])
The {@link https://developer.hashicorp.com/terraform/language/functions/setunion setunion} function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets.
first_set
Required
- Type: any[]
other_sets
Required
- Type: any[][]
sha1
import { FnGenerated } from 'cdktf'
FnGenerated.sha1(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha1 sha1} computes the SHA1 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
sha256
import { FnGenerated } from 'cdktf'
FnGenerated.sha256(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha256 sha256} computes the SHA256 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
sha512
import { FnGenerated } from 'cdktf'
FnGenerated.sha512(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/sha512 sha512} computes the SHA512 hash of a given string and encodes it with hexadecimal digits.
str
Required
- Type: string
signum
import { FnGenerated } from 'cdktf'
FnGenerated.signum(num: number)
{@link https://developer.hashicorp.com/terraform/language/functions/signum signum} determines the sign of a number, returning a number between -1 and 1 to represent the sign.
num
Required
- Type: number
slice
import { FnGenerated } from 'cdktf'
FnGenerated.slice(list: any, start_index: number, end_index: number)
{@link https://developer.hashicorp.com/terraform/language/functions/slice slice} extracts some consecutive elements from within a list.
list
Required
- Type: any
start_index
Required
- Type: number
end_index
Required
- Type: number
sort
import { FnGenerated } from 'cdktf'
FnGenerated.sort(list: string[])
{@link https://developer.hashicorp.com/terraform/language/functions/sort sort} takes a list of strings and returns a new list with those strings sorted lexicographically.
list
Required
- Type: string[]
split
import { FnGenerated } from 'cdktf'
FnGenerated.split(separator: string, str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/split split} produces a list by dividing a given string at all occurrences of a given separator.
separator
Required
- Type: string
str
Required
- Type: string
startswith
import { FnGenerated } from 'cdktf'
FnGenerated.startswith(str: string, prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/startswith startswith} takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.
str
Required
- Type: string
prefix
Required
- Type: string
strcontains
import { FnGenerated } from 'cdktf'
FnGenerated.strcontains(str: string, substr: string)
{@link https://developer.hashicorp.com/terraform/language/functions/strcontains strcontains} takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it.
str
Required
- Type: string
substr
Required
- Type: string
strrev
import { FnGenerated } from 'cdktf'
FnGenerated.strrev(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/strrev strrev} reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected).
str
Required
- Type: string
substr
import { FnGenerated } from 'cdktf'
FnGenerated.substr(str: string, offset: number, length: number)
{@link https://developer.hashicorp.com/terraform/language/functions/substr substr} extracts a substring from a given string by offset and (maximum) length.
str
Required
- Type: string
offset
Required
- Type: number
length
Required
- Type: number
sum
import { FnGenerated } from 'cdktf'
FnGenerated.sum(list: any)
{@link https://developer.hashicorp.com/terraform/language/functions/sum sum} takes a list or set of numbers and returns the sum of those numbers.
list
Required
- Type: any
templatefile
import { FnGenerated } from 'cdktf'
FnGenerated.templatefile(path: string, vars: any)
{@link https://developer.hashicorp.com/terraform/language/functions/templatefile templatefile} reads the file at the given path and renders its content as a template using a supplied set of template variables.
path
Required
- Type: string
vars
Required
- Type: any
textdecodebase64
import { FnGenerated } from 'cdktf'
FnGenerated.textdecodebase64(source: string, encoding: string)
{@link https://developer.hashicorp.com/terraform/language/functions/textdecodebase64 textdecodebase64} function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.
source
Required
- Type: string
encoding
Required
- Type: string
textencodebase64
import { FnGenerated } from 'cdktf'
FnGenerated.textencodebase64(str: string, encoding: string)
{@link https://developer.hashicorp.com/terraform/language/functions/textencodebase64 textencodebase64} encodes the unicode characters in a given string using a specified character encoding, returning the result base64 encoded because Terraform language strings are always sequences of unicode characters.
str
Required
- Type: string
encoding
Required
- Type: string
timeadd
import { FnGenerated } from 'cdktf'
FnGenerated.timeadd(timestamp: string, duration: string)
{@link https://developer.hashicorp.com/terraform/language/functions/timeadd timeadd} adds a duration to a timestamp, returning a new timestamp.
timestamp
Required
- Type: string
duration
Required
- Type: string
timecmp
import { FnGenerated } from 'cdktf'
FnGenerated.timecmp(timestamp_a: string, timestamp_b: string)
{@link https://developer.hashicorp.com/terraform/language/functions/timecmp timecmp} compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.
timestamp_a
Required
- Type: string
timestamp_b
Required
- Type: string
timestamp
import { FnGenerated } from "cdktf";
FnGenerated.timestamp();
{@link https://developer.hashicorp.com/terraform/language/functions/timestamp timestamp} returns a UTC timestamp string in RFC 3339 format.
title
import { FnGenerated } from 'cdktf'
FnGenerated.title(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/title title} converts the first letter of each word in the given string to uppercase.
str
Required
- Type: string
tobool
import { FnGenerated } from 'cdktf'
FnGenerated.tobool(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tobool tobool} converts its argument to a boolean value.
v
Required
- Type: any
tolist
import { FnGenerated } from 'cdktf'
FnGenerated.tolist(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tolist tolist} converts its argument to a list value.
v
Required
- Type: any
tomap
import { FnGenerated } from 'cdktf'
FnGenerated.tomap(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tomap tomap} converts its argument to a map value.
v
Required
- Type: any
tonumber
import { FnGenerated } from 'cdktf'
FnGenerated.tonumber(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tonumber tonumber} converts its argument to a number value.
v
Required
- Type: any
toset
import { FnGenerated } from 'cdktf'
FnGenerated.toset(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/toset toset} converts its argument to a set value.
v
Required
- Type: any
tostring
import { FnGenerated } from 'cdktf'
FnGenerated.tostring(v: any)
{@link https://developer.hashicorp.com/terraform/language/functions/tostring tostring} converts its argument to a string value.
v
Required
- Type: any
transpose
import { FnGenerated } from 'cdktf'
FnGenerated.transpose(values: any)
{@link https://developer.hashicorp.com/terraform/language/functions/transpose transpose} takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.
values
Required
- Type: any
trim
import { FnGenerated } from 'cdktf'
FnGenerated.trim(str: string, cutset: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trim trim} removes the specified set of characters from the start and end of the given string.
str
Required
- Type: string
cutset
Required
- Type: string
trimprefix
import { FnGenerated } from 'cdktf'
FnGenerated.trimprefix(str: string, prefix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimprefix trimprefix} removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged.
str
Required
- Type: string
prefix
Required
- Type: string
trimspace
import { FnGenerated } from 'cdktf'
FnGenerated.trimspace(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimspace trimspace} removes any space characters from the start and end of the given string.
str
Required
- Type: string
trimsuffix
import { FnGenerated } from 'cdktf'
FnGenerated.trimsuffix(str: string, suffix: string)
{@link https://developer.hashicorp.com/terraform/language/functions/trimsuffix trimsuffix} removes the specified suffix from the end of the given string.
str
Required
- Type: string
suffix
Required
- Type: string
try
import { FnGenerated } from 'cdktf'
FnGenerated.try(expressions: any[])
{@link https://developer.hashicorp.com/terraform/language/functions/try try} evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors.
expressions
Required
- Type: any[]
upper
import { FnGenerated } from 'cdktf'
FnGenerated.upper(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/upper upper} converts all cased letters in the given string to uppercase.
str
Required
- Type: string
urlencode
import { FnGenerated } from 'cdktf'
FnGenerated.urlencode(str: string)
{@link https://developer.hashicorp.com/terraform/language/functions/urlencode urlencode} applies URL encoding to a given string.
str
Required
- Type: string
uuid
import { FnGenerated } from "cdktf";
FnGenerated.uuid();
{@link https://developer.hashicorp.com/terraform/language/functions/uuid uuid} generates a unique identifier string.
uuidv5
import { FnGenerated } from 'cdktf'
FnGenerated.uuidv5(namespace: string, name: string)
{@link https://developer.hashicorp.com/terraform/language/functions/uuidv5 uuidv5} generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a "version 5" UUID.
namespace
Required
- Type: string
name
Required
- Type: string
values
import { FnGenerated } from 'cdktf'
FnGenerated.values(mapping: any)
{@link https://developer.hashicorp.com/terraform/language/functions/values values} takes a map and returns a list containing the values of the elements in that map.
mapping
Required
- Type: any
yamldecode
import { FnGenerated } from 'cdktf'
FnGenerated.yamldecode(src: string)
{@link https://developer.hashicorp.com/terraform/language/functions/yamldecode yamldecode} parses a string as a subset of YAML, and produces a representation of its value.
src
Required
- Type: string
yamlencode
import { FnGenerated } from 'cdktf'
FnGenerated.yamlencode(value: any)
{@link https://developer.hashicorp.com/terraform/language/functions/yamlencode yamlencode} encodes a given value to a string using YAML 1.2 block syntax.
value
Required
- Type: any
zipmap
import { FnGenerated } from 'cdktf'
FnGenerated.zipmap(keys: string[], values: any)
{@link https://developer.hashicorp.com/terraform/language/functions/zipmap zipmap} constructs a map from a list of keys and a corresponding list of values.
keys
Required
- Type: string[]
values
Required
- Type: any
Lazy
Lazily produce a value.
Can be used to return a string, list or numeric value whose actual value will only be calculated later, during synthesis.
Initializers
import { Lazy } from "cdktf";
new Lazy();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
anyValue | Produces a lazy token from an untyped value. |
listValue | Returns a list-ified token for a lazy value. |
numberValue | Returns a numberified token for a lazy value. |
stringValue | Returns a stringified token for a lazy value. |
anyValue
import { Lazy } from 'cdktf'
Lazy.anyValue(producer: IAnyProducer, options?: LazyAnyValueOptions)
Produces a lazy token from an untyped value.
producer
Required
- Type: IAnyProducer
The lazy producer.
options
Optional
- Type: LazyAnyValueOptions
Options.
listValue
import { Lazy } from 'cdktf'
Lazy.listValue(producer: IListProducer, options?: LazyListValueOptions)
Returns a list-ified token for a lazy value.
producer
Required
- Type: IListProducer
The producer.
options
Optional
- Type: LazyListValueOptions
Options.
numberValue
import { Lazy } from 'cdktf'
Lazy.numberValue(producer: INumberProducer)
Returns a numberified token for a lazy value.
producer
Required
- Type: INumberProducer
The producer.
stringValue
import { Lazy } from 'cdktf'
Lazy.stringValue(producer: IStringProducer, options?: LazyStringValueOptions)
Returns a stringified token for a lazy value.
producer
Required
- Type: IStringProducer
The producer.
options
Optional
- Type: LazyStringValueOptions
Options.
LazyBase
- Implements: IResolvable
Initializers
import { LazyBase } from "cdktf";
new LazyBase();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
addPostProcessor | No description. |
resolve | Produce the Token's value at resolution time. |
toJSON | Turn this Token into JSON. |
toString | Return a string representation of this resolvable object. |
addPostProcessor
public addPostProcessor(postProcessor: IPostProcessor): void
postProcessor
Required
- Type: IPostProcessor
resolve
public resolve(context: IResolveContext): any
Produce the Token's value at resolution time.
context
Required
- Type: IResolveContext
toJSON
public toJSON(): any
Turn this Token into JSON.
Called automatically when JSON.stringify() is called on a Token.
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
ListTerraformIterator
Initializers
import { ListTerraformIterator } from 'cdktf'
new ListTerraformIterator(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Name | Type | Description |
---|---|---|
list | string[] | IResolvable | number[] | boolean | IResolvable[] | No description. |
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
forExpressionForList | Creates a for expression that results in a list. |
forExpressionForMap | Creates a for expression that results in a map. |
getAny | No description. |
getAnyMap | No description. |
getBoolean | No description. |
getBooleanMap | No description. |
getList | No description. |
getMap | No description. |
getNumber | No description. |
getNumberList | No description. |
getNumberMap | No description. |
getString | No description. |
getStringMap | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluckProperty | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
public dynamic(attributes: {[ key: string ]: any}): IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: {[ key: string ]: any}
forExpressionForList
public forExpressionForList(expression: string | IResolvable): IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: string | IResolvable
The expression to use in the for mapping.
forExpressionForMap
public forExpressionForMap(keyExpression: string | IResolvable, valueExpression: string | IResolvable): IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
keyExpression
Required
- Type: string | IResolvable
The expression to use as key in the for mapping.
valueExpression
Required
- Type: string | IResolvable
The expression to use as value in the for mapping.
getAny
public getAny(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getAnyMap
public getAnyMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getBoolean
public getBoolean(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getBooleanMap
public getBooleanMap(attribute: string): {[ key: string ]: boolean}
attribute
Required
- Type: string
name of the property to retrieve.
getList
public getList(attribute: string): string[]
attribute
Required
- Type: string
name of the property to retrieve.
getMap
public getMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getNumber
public getNumber(attribute: string): number
attribute
Required
- Type: string
name of the property to retrieve.
getNumberList
public getNumberList(attribute: string): number[]
attribute
Required
- Type: string
name of the property to retrieve.
getNumberMap
public getNumberMap(attribute: string): {[ key: string ]: number}
attribute
Required
- Type: string
name of the property to retrieve.
getString
public getString(attribute: string): string
attribute
Required
- Type: string
name of the property to retrieve.
getStringMap
public getStringMap(attribute: string): {[ key: string ]: string}
attribute
Required
- Type: string
name of the property to retrieve.
keys
public keys(): IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluckProperty
public pluckProperty(property: string): IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: string
The property of the iterators values to map to.
values
public values(): IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
fromComplexList | Creates a new iterator from a complex list. |
fromDataSources | Creates a new iterator from a data source that has been created with the for_each argument. |
fromList | Creates a new iterator from a list. |
fromMap | Creates a new iterator from a map. |
fromResources | Creates a new iterator from a resource that has been created with the for_each argument. |
fromComplexList
import { ListTerraformIterator } from 'cdktf'
ListTerraformIterator.fromComplexList(list: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList, mapKeyAttributeName: string)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
const cert = new AcmCertificate(this, "cert", {
domainName: "example.com",
validationMethod: "DNS",
});
const dvoIterator = TerraformIterator.fromComplexList(
cert.domainValidationOptions,
"domain_name"
);
new Route53Record(this, "record", {
allowOverwrite: true,
name: dvoIterator.getString("name"),
records: [dvoIterator.getString("record")],
ttl: 60,
type: dvoIterator.getString("type"),
zoneId: Token.asString(dataAwsRoute53ZoneExample.zoneId),
forEach: dvoIterator,
});
list
Required
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
the list to iterate over.
mapKeyAttributeName
Required
- Type: string
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
fromDataSources
import { ListTerraformIterator } from 'cdktf'
ListTerraformIterator.fromDataSources(resource: ITerraformResource)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
fromList
import { ListTerraformIterator } from 'cdktf'
ListTerraformIterator.fromList(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Creates a new iterator from a list.
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
import { ListTerraformIterator } from 'cdktf'
ListTerraformIterator.fromMap(map: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean})
Creates a new iterator from a map.
map
Required
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
import { ListTerraformIterator } from 'cdktf'
ListTerraformIterator.fromResources(resource: ITerraformResource)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
Properties
Name | Type | Description |
---|---|---|
key | any | Returns the currently entry in the list or set that is being iterated over. |
value | any | Returns the value of the current item iterated over. |
key
Required
public readonly key: any;
- Type: any
Returns the currently entry in the list or set that is being iterated over.
For lists this is the same as iterator.value
. If you need the index,
use count via TerraformCount
:
https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-count
value
Required
public readonly value: any;
- Type: any
Returns the value of the current item iterated over.
Manifest
- Implements: IManifest
Initializers
import { Manifest } from 'cdktf'
new Manifest(version: string, outdir: string, hclOutput: boolean)
Name | Type | Description |
---|---|---|
version | string | No description. |
outdir | string | No description. |
hclOutput | boolean | No description. |
version
Required
- Type: string
outdir
Required
- Type: string
hclOutput
Required
- Type: boolean
Methods
Name | Description |
---|---|
buildManifest | No description. |
forStack | No description. |
writeToFile | No description. |
buildManifest
public buildManifest(): IManifest
forStack
public forStack(stack: TerraformStack): StackManifest
stack
Required
- Type: TerraformStack
writeToFile
public writeToFile(): void
Properties
Name | Type | Description |
---|---|---|
hclOutput | boolean | No description. |
outdir | string | No description. |
stackFileName | string | No description. |
stacks | {[ key: string ]: StackManifest} | No description. |
version | string | No description. |
hclOutput
Required
public readonly hclOutput: boolean;
- Type: boolean
outdir
Required
public readonly outdir: string;
- Type: string
stackFileName
Required
public readonly stackFileName: string;
- Type: string
stacks
Required
public readonly stacks: {[ key: string ]: StackManifest};
- Type: {[ key: string ]: StackManifest}
version
Required
public readonly version: string;
- Type: string
Constants
Name | Type | Description |
---|---|---|
fileName | string | No description. |
stackMetadataPath | string | No description. |
stacksFolder | string | No description. |
fileName
Required
public readonly fileName: string;
- Type: string
stackMetadataPath
Required
public readonly stackMetadataPath: string;
- Type: string
stacksFolder
Required
public readonly stacksFolder: string;
- Type: string
MapList
- Implements: ITerraformAddressable, IInterpolatingParent, IResolvable
Initializers
import { MapList } from 'cdktf'
new MapList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
MapTerraformIterator
Initializers
import { MapTerraformIterator } from 'cdktf'
new MapTerraformIterator(map: AnyMap | StringMap | NumberMap | BooleanMap | ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number})
Name | Type | Description |
---|---|---|
map | AnyMap | StringMap | NumberMap | BooleanMap | ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | No description. |
map
Required
- Type: AnyMap | StringMap | NumberMap | BooleanMap | ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number}
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
forExpressionForList | Creates a for expression that results in a list. |
forExpressionForMap | Creates a for expression that results in a map. |
getAny | No description. |
getAnyMap | No description. |
getBoolean | No description. |
getBooleanMap | No description. |
getList | No description. |
getMap | No description. |
getNumber | No description. |
getNumberList | No description. |
getNumberMap | No description. |
getString | No description. |
getStringMap | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluckProperty | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
public dynamic(attributes: {[ key: string ]: any}): IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: {[ key: string ]: any}
forExpressionForList
public forExpressionForList(expression: string | IResolvable): IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: string | IResolvable
The expression to use in the for mapping.
forExpressionForMap
public forExpressionForMap(keyExpression: string | IResolvable, valueExpression: string | IResolvable): IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
keyExpression
Required
- Type: string | IResolvable
The expression to use as key in the for mapping.
valueExpression
Required
- Type: string | IResolvable
The expression to use as value in the for mapping.
getAny
public getAny(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getAnyMap
public getAnyMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getBoolean
public getBoolean(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getBooleanMap
public getBooleanMap(attribute: string): {[ key: string ]: boolean}
attribute
Required
- Type: string
name of the property to retrieve.
getList
public getList(attribute: string): string[]
attribute
Required
- Type: string
name of the property to retrieve.
getMap
public getMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getNumber
public getNumber(attribute: string): number
attribute
Required
- Type: string
name of the property to retrieve.
getNumberList
public getNumberList(attribute: string): number[]
attribute
Required
- Type: string
name of the property to retrieve.
getNumberMap
public getNumberMap(attribute: string): {[ key: string ]: number}
attribute
Required
- Type: string
name of the property to retrieve.
getString
public getString(attribute: string): string
attribute
Required
- Type: string
name of the property to retrieve.
getStringMap
public getStringMap(attribute: string): {[ key: string ]: string}
attribute
Required
- Type: string
name of the property to retrieve.
keys
public keys(): IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluckProperty
public pluckProperty(property: string): IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: string
The property of the iterators values to map to.
values
public values(): IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
fromComplexList | Creates a new iterator from a complex list. |
fromDataSources | Creates a new iterator from a data source that has been created with the for_each argument. |
fromList | Creates a new iterator from a list. |
fromMap | Creates a new iterator from a map. |
fromResources | Creates a new iterator from a resource that has been created with the for_each argument. |
fromComplexList
import { MapTerraformIterator } from 'cdktf'
MapTerraformIterator.fromComplexList(list: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList, mapKeyAttributeName: string)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
const cert = new AcmCertificate(this, "cert", {
domainName: "example.com",
validationMethod: "DNS",
});
const dvoIterator = TerraformIterator.fromComplexList(
cert.domainValidationOptions,
"domain_name"
);
new Route53Record(this, "record", {
allowOverwrite: true,
name: dvoIterator.getString("name"),
records: [dvoIterator.getString("record")],
ttl: 60,
type: dvoIterator.getString("type"),
zoneId: Token.asString(dataAwsRoute53ZoneExample.zoneId),
forEach: dvoIterator,
});
list
Required
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
the list to iterate over.
mapKeyAttributeName
Required
- Type: string
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
fromDataSources
import { MapTerraformIterator } from 'cdktf'
MapTerraformIterator.fromDataSources(resource: ITerraformResource)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
fromList
import { MapTerraformIterator } from 'cdktf'
MapTerraformIterator.fromList(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Creates a new iterator from a list.
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
import { MapTerraformIterator } from 'cdktf'
MapTerraformIterator.fromMap(map: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean})
Creates a new iterator from a map.
map
Required
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
import { MapTerraformIterator } from 'cdktf'
MapTerraformIterator.fromResources(resource: ITerraformResource)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
Properties
Name | Type | Description |
---|---|---|
key | string | Returns the key of the current entry in the map that is being iterated over. |
value | any | Returns the value of the current item iterated over. |
key
Required
public readonly key: string;
- Type: string
Returns the key of the current entry in the map that is being iterated over.
value
Required
public readonly value: any;
- Type: any
Returns the value of the current item iterated over.
MigrateIds
- Implements: IAspect
For migrating past 0.17 where the feature flag for the old id generation logic was removed after being deprecated since 0.15.
Initializers
import { MigrateIds } from "cdktf";
new MigrateIds();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
visit | All aspects can visit an IConstruct. |
visit
public visit(node: IConstruct): void
All aspects can visit an IConstruct.
node
Required
- Type: constructs.IConstruct
NamedCloudWorkspace
The name of a single Terraform Cloud workspace.
You will only be able to use the workspace specified in the configuration with this working directory, and cannot manage workspaces from the CLI (e.g. terraform workspace select or terraform workspace new).
Initializers
import { NamedCloudWorkspace } from 'cdktf'
new NamedCloudWorkspace(name: string, project?: string)
name
Required
- Type: string
project
Optional
- Type: string
Methods
Name | Description |
---|---|
toTerraform | No description. |
toHclTerraform | No description. |
toTerraform
public toTerraform(): any
toHclTerraform
public toHclTerraform(): any
Properties
name
Required
public readonly name: string;
- Type: string
project
Optional
public readonly project: string;
- Type: string
NamedRemoteWorkspace
- Implements: IRemoteWorkspace
Initializers
import { NamedRemoteWorkspace } from 'cdktf'
new NamedRemoteWorkspace(name: string)
Name | Type | Description |
---|---|---|
name | string | No description. |
name
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
name | string | No description. |
name
Required
public readonly name: string;
- Type: string
NumberListList
Initializers
import { NumberListList } from 'cdktf'
new NumberListList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): number[]
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
NumberListMap
Initializers
import { NumberListMap } from 'cdktf'
new NumberListMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(key: string): number[]
key
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
NumberMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import { NumberMap } from 'cdktf'
new NumberMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
lookup
public lookup(key: string): number
key
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
NumberMapList
Initializers
import { NumberMapList } from 'cdktf'
new NumberMapList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): NumberMap
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
Op
This class contains static functions for all arithmetical and logical operators in the Terraform configuration language.
Initializers
import { Op } from "cdktf";
new Op();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
add | Renders left + right. |
and | Renders left && right. |
div | Renders left / right. |
eq | Renders left == right. |
gt | Renders left > right. |
gte | Renders left >= right. |
lt | Renders left < right. |
lte | Renders left < = right. |
mod | Renders left % right. |
mul | Renders left * right. |
negate | Renders -expression. |
neq | Renders left != right. |
not | Renders !expression. |
or | Renders left || right. |
sub | Renders left - right. |
add
import { Op } from 'cdktf'
Op.add(left: any, right: any)
Renders left + right.
left
Required
- Type: any
right
Required
- Type: any
and
import { Op } from 'cdktf'
Op.and(left: any, right: any)
Renders left && right.
left
Required
- Type: any
right
Required
- Type: any
div
import { Op } from 'cdktf'
Op.div(left: any, right: any)
Renders left / right.
left
Required
- Type: any
right
Required
- Type: any
eq
import { Op } from 'cdktf'
Op.eq(left: any, right: any)
Renders left == right.
left
Required
- Type: any
right
Required
- Type: any
gt
import { Op } from 'cdktf'
Op.gt(left: any, right: any)
Renders left > right.
left
Required
- Type: any
right
Required
- Type: any
gte
import { Op } from 'cdktf'
Op.gte(left: any, right: any)
Renders left >= right.
left
Required
- Type: any
right
Required
- Type: any
lt
import { Op } from 'cdktf'
Op.lt(left: any, right: any)
Renders left < right.
left
Required
- Type: any
right
Required
- Type: any
lte
import { Op } from 'cdktf'
Op.lte(left: any, right: any)
Renders left < = right.
left
Required
- Type: any
right
Required
- Type: any
mod
import { Op } from 'cdktf'
Op.mod(left: any, right: any)
Renders left % right.
left
Required
- Type: any
right
Required
- Type: any
mul
import { Op } from 'cdktf'
Op.mul(left: any, right: any)
Renders left * right.
left
Required
- Type: any
right
Required
- Type: any
negate
import { Op } from 'cdktf'
Op.negate(expression: any)
Renders -expression.
expression
Required
- Type: any
neq
import { Op } from 'cdktf'
Op.neq(left: any, right: any)
Renders left != right.
left
Required
- Type: any
right
Required
- Type: any
not
import { Op } from 'cdktf'
Op.not(expression: any)
Renders !expression.
expression
Required
- Type: any
or
import { Op } from 'cdktf'
Op.or(left: any, right: any)
Renders left || right.
left
Required
- Type: any
right
Required
- Type: any
sub
import { Op } from 'cdktf'
Op.sub(left: any, right: any)
Renders left - right.
left
Required
- Type: any
right
Required
- Type: any
PrefixedRemoteWorkspaces
- Implements: IRemoteWorkspace
Initializers
import { PrefixedRemoteWorkspaces } from 'cdktf'
new PrefixedRemoteWorkspaces(prefix: string)
Name | Type | Description |
---|---|---|
prefix | string | No description. |
prefix
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
prefix | string | No description. |
prefix
Required
public readonly prefix: string;
- Type: string
ResourceTerraformIterator
Initializers
import { ResourceTerraformIterator } from 'cdktf'
new ResourceTerraformIterator(element: ITerraformResource)
Name | Type | Description |
---|---|---|
element | ITerraformResource | No description. |
element
Required
- Type: ITerraformResource
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
forExpressionForList | Creates a for expression that results in a list. |
forExpressionForMap | Creates a for expression that results in a map. |
getAny | No description. |
getAnyMap | No description. |
getBoolean | No description. |
getBooleanMap | No description. |
getList | No description. |
getMap | No description. |
getNumber | No description. |
getNumberList | No description. |
getNumberMap | No description. |
getString | No description. |
getStringMap | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluckProperty | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
public dynamic(attributes: {[ key: string ]: any}): IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: {[ key: string ]: any}
forExpressionForList
public forExpressionForList(expression: string | IResolvable): IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: string | IResolvable
The expression to use in the for mapping.
forExpressionForMap
public forExpressionForMap(keyExpression: string | IResolvable, valueExpression: string | IResolvable): IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
keyExpression
Required
- Type: string | IResolvable
The expression to use as key in the for mapping.
valueExpression
Required
- Type: string | IResolvable
The expression to use as value in the for mapping.
getAny
public getAny(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getAnyMap
public getAnyMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getBoolean
public getBoolean(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getBooleanMap
public getBooleanMap(attribute: string): {[ key: string ]: boolean}
attribute
Required
- Type: string
name of the property to retrieve.
getList
public getList(attribute: string): string[]
attribute
Required
- Type: string
name of the property to retrieve.
getMap
public getMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getNumber
public getNumber(attribute: string): number
attribute
Required
- Type: string
name of the property to retrieve.
getNumberList
public getNumberList(attribute: string): number[]
attribute
Required
- Type: string
name of the property to retrieve.
getNumberMap
public getNumberMap(attribute: string): {[ key: string ]: number}
attribute
Required
- Type: string
name of the property to retrieve.
getString
public getString(attribute: string): string
attribute
Required
- Type: string
name of the property to retrieve.
getStringMap
public getStringMap(attribute: string): {[ key: string ]: string}
attribute
Required
- Type: string
name of the property to retrieve.
keys
public keys(): IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluckProperty
public pluckProperty(property: string): IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: string
The property of the iterators values to map to.
values
public values(): IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
fromComplexList | Creates a new iterator from a complex list. |
fromDataSources | Creates a new iterator from a data source that has been created with the for_each argument. |
fromList | Creates a new iterator from a list. |
fromMap | Creates a new iterator from a map. |
fromResources | Creates a new iterator from a resource that has been created with the for_each argument. |
fromComplexList
import { ResourceTerraformIterator } from 'cdktf'
ResourceTerraformIterator.fromComplexList(list: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList, mapKeyAttributeName: string)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
const cert = new AcmCertificate(this, "cert", {
domainName: "example.com",
validationMethod: "DNS",
});
const dvoIterator = TerraformIterator.fromComplexList(
cert.domainValidationOptions,
"domain_name"
);
new Route53Record(this, "record", {
allowOverwrite: true,
name: dvoIterator.getString("name"),
records: [dvoIterator.getString("record")],
ttl: 60,
type: dvoIterator.getString("type"),
zoneId: Token.asString(dataAwsRoute53ZoneExample.zoneId),
forEach: dvoIterator,
});
list
Required
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
the list to iterate over.
mapKeyAttributeName
Required
- Type: string
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
fromDataSources
import { ResourceTerraformIterator } from 'cdktf'
ResourceTerraformIterator.fromDataSources(resource: ITerraformResource)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
fromList
import { ResourceTerraformIterator } from 'cdktf'
ResourceTerraformIterator.fromList(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Creates a new iterator from a list.
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
import { ResourceTerraformIterator } from 'cdktf'
ResourceTerraformIterator.fromMap(map: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean})
Creates a new iterator from a map.
map
Required
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
import { ResourceTerraformIterator } from 'cdktf'
ResourceTerraformIterator.fromResources(resource: ITerraformResource)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
Properties
Name | Type | Description |
---|---|---|
key | any | Returns the current entry in the list or set that is being iterated over. |
value | any | Returns the value of the current item iterated over. |
key
Required
public readonly key: any;
- Type: any
Returns the current entry in the list or set that is being iterated over.
For lists this is the same as iterator.value
. If you need the index,
use count via TerraformCount
:
https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-count
value
Required
public readonly value: any;
- Type: any
Returns the value of the current item iterated over.
StringConcat
- Implements: IFragmentConcatenator
Converts all fragments to strings and concats those.
Drops 'undefined's.
Initializers
import { StringConcat } from "cdktf";
new StringConcat();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
join | Concatenates string fragments. |
join
public join(left: any, right: any): any
Concatenates string fragments.
left
Required
- Type: any
right
Required
- Type: any
StringListList
Initializers
import { StringListList } from 'cdktf'
new StringListList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
allWithMapKey | Creating an iterator for this complex list. |
computeFqn | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
allWithMapKey
public allWithMapKey(mapKeyAttributeName: string): DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
mapKeyAttributeName
Required
- Type: string
computeFqn
public computeFqn(): string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): string[]
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
StringListMap
Initializers
import { StringListMap } from 'cdktf'
new StringListMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(key: string): string[]
key
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
StringMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import { StringMap } from 'cdktf'
new StringMap(terraformResource: IInterpolatingParent, terraformAttribute: string)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
Methods
Name | Description |
---|---|
computeFqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
computeFqn
public computeFqn(): string
lookup
public lookup(key: string): string
key
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
StringMapList
Initializers
import { StringMapList } from 'cdktf'
new StringMapList(terraformResource: IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)
Name | Type | Description |
---|---|---|
terraformResource | IInterpolatingParent | No description. |
terraformAttribute | string | No description. |
wrapsSet | boolean | No description. |
terraformResource
Required
- Type: IInterpolatingParent
terraformAttribute
Required
- Type: string
wrapsSet
Required
- Type: boolean
Methods
Name | Description |
---|---|
computeFqn | No description. |
interpolationForAttribute | No description. |
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
get | No description. |
computeFqn
public computeFqn(): string
interpolationForAttribute
public interpolationForAttribute(property: string): IResolvable
property
Required
- Type: string
resolve
public resolve(_context: IResolveContext): any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
get
public get(index: number): StringMap
index
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | string | No description. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
fqn
Required
public readonly fqn: string;
- Type: string
TaggedCloudWorkspaces
A set of Terraform Cloud workspace tags.
You will be able to use this working directory with any workspaces that have all of the specified tags, and can use the terraform workspace commands to switch between them or create new workspaces. New workspaces will automatically have the specified tags. This option conflicts with name.
Initializers
import { TaggedCloudWorkspaces } from 'cdktf'
new TaggedCloudWorkspaces(tags: string[], project?: string)
tags
Required
- Type: string[]
project
Optional
- Type: string
Methods
Name | Description |
---|---|
toTerraform | No description. |
toHclTerraform | No description. |
toTerraform
public toTerraform(): any
toHclTerraform
public toHclTerraform(): any
Properties
tags
Required
public readonly tags: string[];
- Type: string[]
project
Optional
public readonly project: string;
- Type: string
TerraformCount
Iterator for the Terraform count property.
Methods
Name | Description |
---|---|
toString | No description. |
toTerraform | No description. |
toString
public toString(): string
toTerraform
public toTerraform(): number
Static Functions
Name | Description |
---|---|
isTerraformCount | No description. |
of | No description. |
isTerraformCount
import { TerraformCount } from 'cdktf'
TerraformCount.isTerraformCount(x: any)
x
Required
- Type: any
of
import { TerraformCount } from 'cdktf'
TerraformCount.of(count: number)
count
Required
- Type: number
Properties
Name | Type | Description |
---|---|---|
index | number | No description. |
index
Required
public readonly index: number;
- Type: number
TerraformIterator
- Implements: ITerraformIterator
Initializers
import { TerraformIterator } from "cdktf";
new TerraformIterator();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
forExpressionForList | Creates a for expression that results in a list. |
forExpressionForMap | Creates a for expression that results in a map. |
getAny | No description. |
getAnyMap | No description. |
getBoolean | No description. |
getBooleanMap | No description. |
getList | No description. |
getMap | No description. |
getNumber | No description. |
getNumberList | No description. |
getNumberMap | No description. |
getString | No description. |
getStringMap | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluckProperty | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
public dynamic(attributes: {[ key: string ]: any}): IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: {[ key: string ]: any}
forExpressionForList
public forExpressionForList(expression: string | IResolvable): IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: string | IResolvable
The expression to use in the for mapping.
forExpressionForMap
public forExpressionForMap(keyExpression: string | IResolvable, valueExpression: string | IResolvable): IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
keyExpression
Required
- Type: string | IResolvable
The expression to use as key in the for mapping.
valueExpression
Required
- Type: string | IResolvable
The expression to use as value in the for mapping.
getAny
public getAny(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getAnyMap
public getAnyMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getBoolean
public getBoolean(attribute: string): IResolvable
attribute
Required
- Type: string
name of the property to retrieve.
getBooleanMap
public getBooleanMap(attribute: string): {[ key: string ]: boolean}
attribute
Required
- Type: string
name of the property to retrieve.
getList
public getList(attribute: string): string[]
attribute
Required
- Type: string
name of the property to retrieve.
getMap
public getMap(attribute: string): {[ key: string ]: any}
attribute
Required
- Type: string
name of the property to retrieve.
getNumber
public getNumber(attribute: string): number
attribute
Required
- Type: string
name of the property to retrieve.
getNumberList
public getNumberList(attribute: string): number[]
attribute
Required
- Type: string
name of the property to retrieve.
getNumberMap
public getNumberMap(attribute: string): {[ key: string ]: number}
attribute
Required
- Type: string
name of the property to retrieve.
getString
public getString(attribute: string): string
attribute
Required
- Type: string
name of the property to retrieve.
getStringMap
public getStringMap(attribute: string): {[ key: string ]: string}
attribute
Required
- Type: string
name of the property to retrieve.
keys
public keys(): IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluckProperty
public pluckProperty(property: string): IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: string
The property of the iterators values to map to.
values
public values(): IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
fromComplexList | Creates a new iterator from a complex list. |
fromDataSources | Creates a new iterator from a data source that has been created with the for_each argument. |
fromList | Creates a new iterator from a list. |
fromMap | Creates a new iterator from a map. |
fromResources | Creates a new iterator from a resource that has been created with the for_each argument. |
fromComplexList
import { TerraformIterator } from 'cdktf'
TerraformIterator.fromComplexList(list: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList, mapKeyAttributeName: string)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
const cert = new AcmCertificate(this, "cert", {
domainName: "example.com",
validationMethod: "DNS",
});
const dvoIterator = TerraformIterator.fromComplexList(
cert.domainValidationOptions,
"domain_name"
);
new Route53Record(this, "record", {
allowOverwrite: true,
name: dvoIterator.getString("name"),
records: [dvoIterator.getString("record")],
ttl: 60,
type: dvoIterator.getString("type"),
zoneId: Token.asString(dataAwsRoute53ZoneExample.zoneId),
forEach: dvoIterator,
});
list
Required
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
the list to iterate over.
mapKeyAttributeName
Required
- Type: string
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
fromDataSources
import { TerraformIterator } from 'cdktf'
TerraformIterator.fromDataSources(resource: ITerraformResource)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
fromList
import { TerraformIterator } from 'cdktf'
TerraformIterator.fromList(list: string[] | IResolvable | number[] | boolean | IResolvable[])
Creates a new iterator from a list.
list
Required
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
import { TerraformIterator } from 'cdktf'
TerraformIterator.fromMap(map: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean})
Creates a new iterator from a map.
map
Required
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
import { TerraformIterator } from 'cdktf'
TerraformIterator.fromResources(resource: ITerraformResource)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
TerraformResourceTargets
Initializers
import { TerraformResourceTargets } from "cdktf";
new TerraformResourceTargets();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
addResourceTarget | No description. |
getResourceByTarget | No description. |
addResourceTarget
public addResourceTarget(resource: TerraformResource, target: string): void
resource
Required
- Type: TerraformResource
target
Required
- Type: string
getResourceByTarget
public getResourceByTarget(target: string): TerraformResource
target
Required
- Type: string
TerraformSelf
Expressions in connection blocks cannot refer to their parent resource by name.
References create dependencies, and referring to a resource by name within its own block would create a dependency cycle. Instead, expressions can use the self object, which represents the connection's parent resource and has all of that resource's attributes. For example, use self.public_ip to reference an aws_instance's public_ip attribute.
Initializers
import { TerraformSelf } from "cdktf";
new TerraformSelf();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
getAny | Only usable within a connection block to reference the connections parent resource. |
getNumber | Only usable within a connection block to reference the connections parent resource. |
getString | Only usable within a connection block to reference the connections parent resource. |
getAny
import { TerraformSelf } from 'cdktf'
TerraformSelf.getAny(key: string)
Only usable within a connection block to reference the connections parent resource.
Access a property on the resource like this: getAny("hostPort")
key
Required
- Type: string
getNumber
import { TerraformSelf } from 'cdktf'
TerraformSelf.getNumber(key: string)
Only usable within a connection block to reference the connections parent resource.
Access a property on the resource like this: getNumber("hostPort")
key
Required
- Type: string
getString
import { TerraformSelf } from 'cdktf'
TerraformSelf.getString(key: string)
Only usable within a connection block to reference the connections parent resource.
Access a property on the resource like this: getString("publicIp")
key
Required
- Type: string
Testing
Testing utilities for cdktf applications.
Initializers
import { Testing } from "cdktf";
new Testing();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
app | Returns an app for testing with the following properties: - Output directory is a temp dir. |
enableFutureFlags | No description. |
fakeCdktfJsonPath | No description. |
fullSynth | No description. |
renderConstructTree | No description. |
setupJest | No description. |
stubVersion | No description. |
synth | Returns the Terraform synthesized JSON. |
synthHcl | Returns the Terraform synthesized JSON. |
synthScope | No description. |
toBeValidTerraform | No description. |
toHaveDataSource | No description. |
toHaveDataSourceWithProperties | No description. |
toHaveProvider | No description. |
toHaveProviderWithProperties | No description. |
toHaveResource | No description. |
toHaveResourceWithProperties | No description. |
app
import { Testing } from 'cdktf'
Testing.app(options?: TestingAppConfig)
Returns an app for testing with the following properties: - Output directory is a temp dir.
options
Optional
- Type: TestingAppConfig
enableFutureFlags
import { Testing } from 'cdktf'
Testing.enableFutureFlags(app: App)
app
Required
- Type: App
fakeCdktfJsonPath
import { Testing } from 'cdktf'
Testing.fakeCdktfJsonPath(app: App)
app
Required
- Type: App
fullSynth
import { Testing } from 'cdktf'
Testing.fullSynth(stack: TerraformStack)
stack
Required
- Type: TerraformStack
renderConstructTree
import { Testing } from 'cdktf'
Testing.renderConstructTree(construct: IConstruct)
construct
Required
- Type: constructs.IConstruct
setupJest
import { Testing } from "cdktf";
Testing.setupJest();
stubVersion
import { Testing } from 'cdktf'
Testing.stubVersion(app: App)
app
Required
- Type: App
synth
import { Testing } from 'cdktf'
Testing.synth(stack: TerraformStack, runValidations?: boolean)
Returns the Terraform synthesized JSON.
stack
Required
- Type: TerraformStack
runValidations
Optional
- Type: boolean
synthHcl
import { Testing } from 'cdktf'
Testing.synthHcl(stack: TerraformStack, runValidations?: boolean, returnMetadata?: boolean)
Returns the Terraform synthesized JSON.
stack
Required
- Type: TerraformStack
runValidations
Optional
- Type: boolean
returnMetadata
Optional
- Type: boolean
synthScope
import { Testing } from 'cdktf'
Testing.synthScope(fn: IScopeCallback)
fn
Required
- Type: IScopeCallback
toBeValidTerraform
import { Testing } from 'cdktf'
Testing.toBeValidTerraform(received: string)
received
Required
- Type: string
toHaveDataSource
import { Testing } from 'cdktf'
Testing.toHaveDataSource(received: string, resourceType: string)
received
Required
- Type: string
resourceType
Required
- Type: string
toHaveDataSourceWithProperties
import { Testing } from 'cdktf'
Testing.toHaveDataSourceWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})
received
Required
- Type: string
resourceType
Required
- Type: string
properties
Optional
- Type: {[ key: string ]: any}
toHaveProvider
import { Testing } from 'cdktf'
Testing.toHaveProvider(received: string, resourceType: string)
received
Required
- Type: string
resourceType
Required
- Type: string
toHaveProviderWithProperties
import { Testing } from 'cdktf'
Testing.toHaveProviderWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})
received
Required
- Type: string
resourceType
Required
- Type: string
properties
Optional
- Type: {[ key: string ]: any}
toHaveResource
import { Testing } from 'cdktf'
Testing.toHaveResource(received: string, resourceType: string)
received
Required
- Type: string
resourceType
Required
- Type: string
toHaveResourceWithProperties
import { Testing } from 'cdktf'
Testing.toHaveResourceWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})
received
Required
- Type: string
resourceType
Required
- Type: string
properties
Optional
- Type: {[ key: string ]: any}
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.
Initializers
import { Token } from "cdktf";
new Token();
Name | Type | Description |
---|
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 'cdktf'
Token.asAny(value: any)
Return a resolvable representation of the given value.
value
Required
- Type: any
asAnyMap
import { Token } from 'cdktf'
Token.asAnyMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
asBooleanMap
import { Token } from 'cdktf'
Token.asBooleanMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
asList
import { Token } from 'cdktf'
Token.asList(value: any, options?: EncodingOptions)
Return a reversible list representation of this token.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
asMap
import { Token } from 'cdktf'
Token.asMap(value: any, mapValue: any, options?: EncodingOptions)
Return a reversible map representation of this token.
value
Required
- Type: any
mapValue
Required
- Type: any
options
Optional
- Type: EncodingOptions
asNumber
import { Token } from 'cdktf'
Token.asNumber(value: any)
Return a reversible number representation of this token.
value
Required
- Type: any
asNumberList
import { Token } from 'cdktf'
Token.asNumberList(value: any)
Return a reversible list representation of this token.
value
Required
- Type: any
asNumberMap
import { Token } from 'cdktf'
Token.asNumberMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
asString
import { Token } from 'cdktf'
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.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
asStringMap
import { Token } from 'cdktf'
Token.asStringMap(value: any, options?: EncodingOptions)
Return a reversible map representation of this token.
value
Required
- Type: any
options
Optional
- Type: EncodingOptions
isUnresolved
import { Token } from 'cdktf'
Token.isUnresolved(obj: any)
Returns true if obj represents an unresolved value.
One of these must be true:
obj
is an IResolvableobj
is a string containing at least one encodedIResolvable
obj
is either an encoded number or list
This does NOT recurse into lists or objects to see if they containing resolvables.
obj
Required
- Type: any
The object to test.
nullValue
import { Token } from "cdktf";
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_VALUE
Required
public readonly ANY_MAP_TOKEN_VALUE: string;
- Type: string
Any map token representation.
NUMBER_MAP_TOKEN_VALUE
Required
public readonly NUMBER_MAP_TOKEN_VALUE: number;
- Type: number
Number Map token value representation.
STRING_MAP_TOKEN_VALUE
Required
public readonly STRING_MAP_TOKEN_VALUE: string;
- Type: string
String Map token value representation.
Tokenization
Less oft-needed functions to manipulate Tokens.
Initializers
import { Tokenization } from "cdktf";
new Tokenization();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
isResolvable | Return whether the given object is an IResolvable object. |
resolve | Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays. |
reverse | Reverse any value into Resolvables, if possible. |
reverseList | Un-encode a Tokenized value from a list. |
reverseMap | Un-encode a Tokenized value from a map. |
reverseNumber | Un-encode a Tokenized value from a number. |
reverseNumberList | Un-encode a Tokenized value from a list. |
reverseString | Un-encode a string potentially containing encoded tokens. |
stringifyNumber | Stringify a number directly or lazily if it's a Token. |
isResolvable
import { Tokenization } from 'cdktf'
Tokenization.isResolvable(obj: any)
Return whether the given object is an IResolvable object.
This is different from Token.isUnresolved() which will also check for encoded Tokens, whereas this method will only do a type check on the given object.
obj
Required
- Type: any
resolve
import { Tokenization } from 'cdktf'
Tokenization.resolve(obj: any, options: ResolveOptions)
Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays.
Values can only be primitives, arrays or tokens. Other objects (i.e. with methods) will be rejected.
obj
Required
- Type: any
The object to resolve.
options
Required
- Type: ResolveOptions
Prefix key path components for diagnostics.
reverse
import { Tokenization } from 'cdktf'
Tokenization.reverse(x: any)
Reverse any value into Resolvables, if possible.
x
Required
- Type: any
reverseList
import { Tokenization } from 'cdktf'
Tokenization.reverseList(l: string[])
Un-encode a Tokenized value from a list.
l
Required
- Type: string[]
reverseMap
import { Tokenization } from 'cdktf'
Tokenization.reverseMap(m: {[ key: string ]: any})
Un-encode a Tokenized value from a map.
m
Required
- Type: {[ key: string ]: any}
reverseNumber
import { Tokenization } from 'cdktf'
Tokenization.reverseNumber(n: number)
Un-encode a Tokenized value from a number.
n
Required
- Type: number
reverseNumberList
import { Tokenization } from 'cdktf'
Tokenization.reverseNumberList(l: number[])
Un-encode a Tokenized value from a list.
l
Required
- Type: number[]
reverseString
import { Tokenization } from 'cdktf'
Tokenization.reverseString(s: string)
Un-encode a string potentially containing encoded tokens.
s
Required
- Type: string
stringifyNumber
import { Tokenization } from 'cdktf'
Tokenization.stringifyNumber(x: number)
Stringify a number directly or lazily if it's a Token.
If it is an object (i.e., { Ref: 'SomeLogicalId' }), return it as-is.
x
Required
- Type: number
TokenizedStringFragments
Fragments of a concatenated string containing stringified Tokens.
Initializers
import { TokenizedStringFragments } from "cdktf";
new TokenizedStringFragments();
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
addEscape | No description. |
addIntrinsic | Adds an intrinsic fragment. |
addLiteral | Adds a literal fragment. |
addToken | Adds a token fragment. |
concat | No description. |
join | Combine the string fragments using the given joiner. |
mapTokens | Apply a transformation function to all tokens in the string. |
addEscape
public addEscape(kind: string): void
kind
Required
- Type: string
addIntrinsic
public addIntrinsic(value: any): void
Adds an intrinsic fragment.
value
Required
- Type: any
the intrinsic value to add.
addLiteral
public addLiteral(lit: any): void
Adds a literal fragment.
lit
Required
- Type: any
the literal to add.
addToken
public addToken(token: IResolvable): void
Adds a token fragment.
token
Required
- Type: IResolvable
the token to add.
concat
public concat(other: TokenizedStringFragments): void
other
Required
- Type: TokenizedStringFragments
join
public join(concat: IFragmentConcatenator): any
Combine the string fragments using the given joiner.
If there are any
concat
Required
- Type: IFragmentConcatenator
mapTokens
public mapTokens(context: IResolveContext): TokenizedStringFragments
Apply a transformation function to all tokens in the string.
context
Required
- Type: IResolveContext
Properties
Name | Type | Description |
---|---|---|
escapes | IResolvable[] | Return all escape fragments from this string. |
firstValue | any | Returns the first value. |
intrinsic | IResolvable[] | Return all intrinsic fragments from this string. |
length | number | Returns the number of fragments. |
literals | IResolvable[] | Return all literals from this string. |
tokens | IResolvable[] | Return all Tokens from this string. |
firstToken | IResolvable | Returns the first token. |
escapes
Required
public readonly escapes: IResolvable[];
- Type: IResolvable[]
Return all escape fragments from this string.
firstValue
Required
public readonly firstValue: any;
- Type: any
Returns the first value.
intrinsic
Required
public readonly intrinsic: IResolvable[];
- Type: IResolvable[]
Return all intrinsic fragments from this string.
length
Required
public readonly length: number;
- Type: number
Returns the number of fragments.
literals
Required
public readonly literals: IResolvable[];
- Type: IResolvable[]
Return all literals from this string.
tokens
Required
public readonly tokens: IResolvable[];
- Type: IResolvable[]
Return all Tokens from this string.
firstToken
Optional
public readonly firstToken: IResolvable;
- Type: IResolvable
Returns the first token.
VariableType
Initializers
import { VariableType } from "cdktf";
new VariableType();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
list | No description. |
map | No description. |
object | No description. |
set | No description. |
tuple | No description. |
list
import { VariableType } from 'cdktf'
VariableType.list(type: string)
type
Required
- Type: string
map
import { VariableType } from 'cdktf'
VariableType.map(type: string)
type
Required
- Type: string
object
import { VariableType } from 'cdktf'
VariableType.object(attributes: {[ key: string ]: string})
attributes
Required
- Type: {[ key: string ]: string}
set
import { VariableType } from 'cdktf'
VariableType.set(type: string)
type
Required
- Type: string
tuple
import { VariableType } from 'cdktf'
VariableType.tuple(elements: ...string[])
elements
Required
- Type: ...string[]
Constants
Name | Type | Description |
---|---|---|
ANY | string | No description. |
BOOL | string | No description. |
LIST | string | No description. |
LIST_BOOL | string | No description. |
LIST_NUMBER | string | No description. |
LIST_STRING | string | No description. |
MAP | string | No description. |
MAP_BOOL | string | No description. |
MAP_NUMBER | string | No description. |
MAP_STRING | string | No description. |
NUMBER | string | No description. |
SET | string | No description. |
SET_BOOL | string | No description. |
SET_NUMBER | string | No description. |
SET_STRING | string | No description. |
STRING | string | No description. |
ANY
Required
public readonly ANY: string;
- Type: string
BOOL
Required
public readonly BOOL: string;
- Type: string
LIST
Required
public readonly LIST: string;
- Type: string
LIST_BOOL
Required
public readonly LIST_BOOL: string;
- Type: string
LIST_NUMBER
Required
public readonly LIST_NUMBER: string;
- Type: string
LIST_STRING
Required
public readonly LIST_STRING: string;
- Type: string
MAP
Required
public readonly MAP: string;
- Type: string
MAP_BOOL
Required
public readonly MAP_BOOL: string;
- Type: string
MAP_NUMBER
Required
public readonly MAP_NUMBER: string;
- Type: string
MAP_STRING
Required
public readonly MAP_STRING: string;
- Type: string
NUMBER
Required
public readonly NUMBER: string;
- Type: string
SET
Required
public readonly SET: string;
- Type: string
SET_BOOL
Required
public readonly SET_BOOL: string;
- Type: string
SET_NUMBER
Required
public readonly SET_NUMBER: string;
- Type: string
SET_STRING
Required
public readonly SET_STRING: string;
- Type: string
STRING
Required
public readonly STRING: string;
- Type: string