- Implements: ITerraformIterator
Initializers
| Name | Type | Description |
|---|
Methods
| Name | Description |
|---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
for_expression_for_list | Creates a for expression that results in a list. |
for_expression_for_map | Creates a for expression that results in a map. |
get_any | No description. |
get_any_map | No description. |
get_boolean | No description. |
get_boolean_map | No description. |
get_list | No description. |
get_map | No description. |
get_number | No description. |
get_number_list | No description. |
get_number_map | No description. |
get_string | No description. |
get_string_map | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluck_property | 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: typing.Mapping[typing.Any]
for_expression_for_list
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: str | IResolvable
for_expression_for_map
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.
key_expressionRequired
- Type: str | IResolvable
value_expressionRequired
- Type: str | IResolvable
get_any
attributeRequired
- Type: str
get_any_map
attributeRequired
- Type: str
get_boolean
attributeRequired
- Type: str
get_boolean_map
attributeRequired
- Type: str
get_list
attributeRequired
- Type: str
get_map
attributeRequired
- Type: str
get_number
attributeRequired
- Type: str
get_number_list
attributeRequired
- Type: str
get_number_map
attributeRequired
- Type: str
get_string
attributeRequired
- Type: str
get_string_map
attributeRequired
- Type: str
keys
Token.asString.
pluck_property
Token.asString.
propertyRequired
- Type: str
values
Token.asString.
Static Functions
| Name | Description |
|---|---|
from_complex_list | Creates a new iterator from a complex list. |
from_data_sources | Creates a new iterator from a data source that has been created with the for_each argument. |
from_list | Creates a new iterator from a list. |
from_map | Creates a new iterator from a map. |
from_resources | Creates a new iterator from a resource that has been created with the for_each argument. |
from_complex_list
listRequired
- Type: IResolvable | ComplexList | StringMapList | NumberMapList | BooleanMapList | AnyMapList
map_key_attribute_nameRequired
- Type: str
from_data_sources
for_each argument.
resourceRequired
- Type: ITerraformResource
from_list
listRequired
- Type: typing.List[str] | IResolvable | typing.List[typing.Union[int, float]] | typing.List[bool | IResolvable]
from_map
mapRequired
- Type: ComplexMap | typing.Mapping[typing.Any] | typing.Mapping[str] | typing.Mapping[typing.Union[int, float]] | typing.Mapping[bool]
from_resources
for_each argument.
resourceRequired
- Type: ITerraformResource