Initializers
| Name | Type | Description |
|---|---|---|
map | AnyMap | StringMap | NumberMap | BooleanMap | ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | No description. |
mapRequired
- 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
Token.asString.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributesRequired
- Type: {[ key: string ]: any}
forExpressionForList
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.
expressionRequired
- Type: string | IResolvable
forExpressionForMap
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.
keyExpressionRequired
- Type: string | IResolvable
valueExpressionRequired
- Type: string | IResolvable
getAny
attributeRequired
- Type: string
getAnyMap
attributeRequired
- Type: string
getBoolean
attributeRequired
- Type: string
getBooleanMap
attributeRequired
- Type: string
getList
attributeRequired
- Type: string
getMap
attributeRequired
- Type: string
getNumber
attributeRequired
- Type: string
getNumberList
attributeRequired
- Type: string
getNumberMap
attributeRequired
- Type: string
getString
attributeRequired
- Type: string
getStringMap
attributeRequired
- Type: string
keys
Token.asString.
pluckProperty
Token.asString.
propertyRequired
- Type: string
values
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
listRequired
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
mapKeyAttributeNameRequired
- Type: string
fromDataSources
for_each argument.
resourceRequired
- Type: ITerraformResource
fromList
listRequired
- Type: string[] | IResolvable | number[] | boolean | IResolvable[]
fromMap
mapRequired
- Type: ComplexMap | {[ key: string ]: any} | {[ key: string ]: string} | {[ key: string ]: number} | {[ key: string ]: boolean}
fromResources
for_each argument.
resourceRequired
- Type: ITerraformResource
Properties
keyRequired
- Type: string
valueRequired
- Type: any