Skip to main content
TerraformIterator is used with the forEach meta-argument to create multiple instances of a resource or data source.

Static Methods

fromList()

Creates an iterator from a list.

fromMap()

Creates an iterator from a map.

Properties

key

readonly key: string The key of the current element (for maps) or the index (for lists).

value

readonly value: any The value of the current element.

Methods

getString()

Returns a string attribute from the current element.

getNumber()

Returns a number attribute from the current element.

getBoolean()

Returns a boolean attribute from the current element.

getList()

Returns a list attribute from the current element.

getMap()

Returns a map attribute from the current element.

TerraformCount

TerraformCount is used with the count meta-argument.

index

readonly index: number The current index in the count loop.