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()

static fromList(list: any[]): TerraformIterator
Creates an iterator from a list.

fromMap()

static fromMap(map: Record<string, any>): TerraformIterator
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()

getString(name: string): string
Returns a string attribute from the current element.

getNumber()

getNumber(name: string): number
Returns a number attribute from the current element.

getBoolean()

getBoolean(name: string): boolean
Returns a boolean attribute from the current element.

getList()

getList(name: string): string[]
Returns a list attribute from the current element.

getMap()

getMap(name: string): Record<string, any>
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.