> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Go: DynamicListTerraformIterator

> CDKTN Core API Reference for DynamicListTerraformIterator in Go.

## Initializers <a name="Initializers" id="cdktn.DynamicListTerraformIterator.Initializer" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.NewDynamicListTerraformIterator(list interface{}, mapKeyAttributeName *string) DynamicListTerraformIterator
```

| **Name**                                                                                                                     | **Type**                  | **Description**   |
| ---------------------------------------------------------------------------------------------------------------------------- | ------------------------- | ----------------- |
| <code><a href="#cdktn.DynamicListTerraformIterator.Initializer.parameter.list">list</a></code>                               | <code>interface\{}</code> | *No description.* |
| <code><a href="#cdktn.DynamicListTerraformIterator.Initializer.parameter.mapKeyAttributeName">mapKeyAttributeName</a></code> | <code>\*string</code>     | *No description.* |

***

### `list`<sup>Required</sup> <a name="list" id="cdktn.DynamicListTerraformIterator.Initializer.parameter.list" />

* *Type:* interface\{}

***

### `mapKeyAttributeName`<sup>Required</sup> <a name="mapKeyAttributeName" id="cdktn.DynamicListTerraformIterator.Initializer.parameter.mapKeyAttributeName" />

* *Type:* \*string

***

## Methods <a name="Methods" id="Methods" />

| **Name**                                                                                                 | **Description**                                                                              |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.DynamicListTerraformIterator.dynamic">Dynamic</a></code>                           | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
| <code><a href="#cdktn.DynamicListTerraformIterator.forExpressionForList">ForExpressionForList</a></code> | Creates a for expression that results in a list.                                             |
| <code><a href="#cdktn.DynamicListTerraformIterator.forExpressionForMap">ForExpressionForMap</a></code>   | Creates a for expression that results in a map.                                              |
| <code><a href="#cdktn.DynamicListTerraformIterator.getAny">GetAny</a></code>                             | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getAnyMap">GetAnyMap</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getBoolean">GetBoolean</a></code>                     | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getBooleanMap">GetBooleanMap</a></code>               | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getList">GetList</a></code>                           | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getMap">GetMap</a></code>                             | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getNumber">GetNumber</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getNumberList">GetNumberList</a></code>               | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getNumberMap">GetNumberMap</a></code>                 | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getString">GetString</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.getStringMap">GetStringMap</a></code>                 | *No description.*                                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.keys">Keys</a></code>                                 | Creates a for expression that maps the iterators to its keys.                                |
| <code><a href="#cdktn.DynamicListTerraformIterator.pluckProperty">PluckProperty</a></code>               | Creates a for expression that accesses the key on each element of the iterator.              |
| <code><a href="#cdktn.DynamicListTerraformIterator.values">Values</a></code>                             | Creates a for expression that maps the iterators to its value in case it is a map.           |

***

### `Dynamic` <a name="Dynamic" id="cdktn.DynamicListTerraformIterator.dynamic" />

```go theme={null}
func Dynamic(attributes *map[string]interface{}) 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://cdktn.io/docs/concepts/iterators#using-iterators-for-list-attributes](https://cdktn.io/docs/concepts/iterators#using-iterators-for-list-attributes)

#### `attributes`<sup>Required</sup> <a name="attributes" id="cdktn.DynamicListTerraformIterator.dynamic.parameter.attributes" />

* *Type:* \*map\[string]interface\{}

***

### `ForExpressionForList` <a name="ForExpressionForList" id="cdktn.DynamicListTerraformIterator.forExpressionForList" />

```go theme={null}
func ForExpressionForList(expression interface{}) 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`<sup>Required</sup> <a name="expression" id="cdktn.DynamicListTerraformIterator.forExpressionForList.parameter.expression" />

* *Type:* interface\{}

The expression to use in the for mapping.

***

### `ForExpressionForMap` <a name="ForExpressionForMap" id="cdktn.DynamicListTerraformIterator.forExpressionForMap" />

```go theme={null}
func ForExpressionForMap(keyExpression interface{}, valueExpression interface{}) 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`<sup>Required</sup> <a name="keyExpression" id="cdktn.DynamicListTerraformIterator.forExpressionForMap.parameter.keyExpression" />

* *Type:* interface\{}

The expression to use as key in the for mapping.

***

#### `valueExpression`<sup>Required</sup> <a name="valueExpression" id="cdktn.DynamicListTerraformIterator.forExpressionForMap.parameter.valueExpression" />

* *Type:* interface\{}

The expression to use as value in the for mapping.

***

### `GetAny` <a name="GetAny" id="cdktn.DynamicListTerraformIterator.getAny" />

```go theme={null}
func GetAny(attribute *string) IResolvable
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getAny.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetAnyMap` <a name="GetAnyMap" id="cdktn.DynamicListTerraformIterator.getAnyMap" />

```go theme={null}
func GetAnyMap(attribute *string) *map[string]interface{}
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getAnyMap.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetBoolean` <a name="GetBoolean" id="cdktn.DynamicListTerraformIterator.getBoolean" />

```go theme={null}
func GetBoolean(attribute *string) IResolvable
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getBoolean.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetBooleanMap` <a name="GetBooleanMap" id="cdktn.DynamicListTerraformIterator.getBooleanMap" />

```go theme={null}
func GetBooleanMap(attribute *string) *map[string]*bool
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getBooleanMap.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetList` <a name="GetList" id="cdktn.DynamicListTerraformIterator.getList" />

```go theme={null}
func GetList(attribute *string) *[]*string
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getList.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetMap` <a name="GetMap" id="cdktn.DynamicListTerraformIterator.getMap" />

```go theme={null}
func GetMap(attribute *string) *map[string]interface{}
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getMap.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetNumber` <a name="GetNumber" id="cdktn.DynamicListTerraformIterator.getNumber" />

```go theme={null}
func GetNumber(attribute *string) *f64
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getNumber.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetNumberList` <a name="GetNumberList" id="cdktn.DynamicListTerraformIterator.getNumberList" />

```go theme={null}
func GetNumberList(attribute *string) *[]*f64
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getNumberList.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetNumberMap` <a name="GetNumberMap" id="cdktn.DynamicListTerraformIterator.getNumberMap" />

```go theme={null}
func GetNumberMap(attribute *string) *map[string]*f64
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getNumberMap.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetString` <a name="GetString" id="cdktn.DynamicListTerraformIterator.getString" />

```go theme={null}
func GetString(attribute *string) *string
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getString.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `GetStringMap` <a name="GetStringMap" id="cdktn.DynamicListTerraformIterator.getStringMap" />

```go theme={null}
func GetStringMap(attribute *string) *map[string]*string
```

#### `attribute`<sup>Required</sup> <a name="attribute" id="cdktn.DynamicListTerraformIterator.getStringMap.parameter.attribute" />

* *Type:* \*string

name of the property to retrieve.

***

### `Keys` <a name="Keys" id="cdktn.DynamicListTerraformIterator.keys" />

```go theme={null}
func 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` <a name="PluckProperty" id="cdktn.DynamicListTerraformIterator.pluckProperty" />

```go theme={null}
func 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`<sup>Required</sup> <a name="property" id="cdktn.DynamicListTerraformIterator.pluckProperty.parameter.property" />

* *Type:* \*string

The property of the iterators values to map to.

***

### `Values` <a name="Values" id="cdktn.DynamicListTerraformIterator.values" />

```go theme={null}
func 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 <a name="Static Functions" id="Static Functions" />

| **Name**                                                                                       | **Description**                                                                               |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.DynamicListTerraformIterator.fromComplexList">FromComplexList</a></code> | Creates a new iterator from a complex list.                                                   |
| <code><a href="#cdktn.DynamicListTerraformIterator.fromDataSources">FromDataSources</a></code> | Creates a new iterator from a data source that has been created with the `for_each` argument. |
| <code><a href="#cdktn.DynamicListTerraformIterator.fromList">FromList</a></code>               | Creates a new iterator from a list.                                                           |
| <code><a href="#cdktn.DynamicListTerraformIterator.fromMap">FromMap</a></code>                 | Creates a new iterator from a map.                                                            |
| <code><a href="#cdktn.DynamicListTerraformIterator.fromResources">FromResources</a></code>     | Creates a new iterator from a resource that has been created with the `for_each` argument.    |

***

### `FromComplexList` <a name="FromComplexList" id="cdktn.DynamicListTerraformIterator.fromComplexList" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.DynamicListTerraformIterator_FromComplexList(list interface{}, mapKeyAttributeName *string) DynamicListTerraformIterator
```

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*

```go theme={null}
// Example automatically generated from non-compiling source. May contain errors.
cert := NewAcmCertificate(this, jsii.String("cert"), map[string]*string{
	"domainName": jsii.String("example.com"),
	"validationMethod": jsii.String("DNS"),
})

dvoIterator := terraformIterator_FromComplexList(cert.domainValidationOptions, jsii.String("domain_name"))

NewRoute53Record(this, jsii.String("record"), map[string]interface{}{
	"allowOverwrite": jsii.Boolean(true),
	"name": dvoIterator.getString(jsii.String("name")),
	"records": []interface{}{
		dvoIterator.getString(jsii.String("record")),
	},
	"ttl": jsii.Number(60),
	"type": dvoIterator.getString(jsii.String("type")),
	"zoneId": Token_asString(dataAwsRoute53ZoneExample.zoneId),
	"forEach": dvoIterator,
})
```

#### `list`<sup>Required</sup> <a name="list" id="cdktn.DynamicListTerraformIterator.fromComplexList.parameter.list" />

* *Type:* interface\{}

the list to iterate over.

***

#### `mapKeyAttributeName`<sup>Required</sup> <a name="mapKeyAttributeName" id="cdktn.DynamicListTerraformIterator.fromComplexList.parameter.mapKeyAttributeName" />

* *Type:* \*string

the name of the attribute that should be used as the key in the map.

Visit [https://cdktn.io/docs/concepts/iterators#using-iterators-on-complex-lists](https://cdktn.io/docs/concepts/iterators#using-iterators-on-complex-lists) for more information.

***

### `FromDataSources` <a name="FromDataSources" id="cdktn.DynamicListTerraformIterator.fromDataSources" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.DynamicListTerraformIterator_FromDataSources(resource ITerraformResource) ResourceTerraformIterator
```

Creates a new iterator from a data source that has been created with the `for_each` argument.

#### `resource`<sup>Required</sup> <a name="resource" id="cdktn.DynamicListTerraformIterator.fromDataSources.parameter.resource" />

* *Type:* <a href="#cdktn.ITerraformResource">ITerraformResource</a>

***

### `FromList` <a name="FromList" id="cdktn.DynamicListTerraformIterator.fromList" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.DynamicListTerraformIterator_FromList(list interface{}) ListTerraformIterator
```

Creates a new iterator from a list.

#### `list`<sup>Required</sup> <a name="list" id="cdktn.DynamicListTerraformIterator.fromList.parameter.list" />

* *Type:* interface\{}

***

### `FromMap` <a name="FromMap" id="cdktn.DynamicListTerraformIterator.fromMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.DynamicListTerraformIterator_FromMap(map interface{}) MapTerraformIterator
```

Creates a new iterator from a map.

#### `map`<sup>Required</sup> <a name="map" id="cdktn.DynamicListTerraformIterator.fromMap.parameter.map" />

* *Type:* interface\{}

***

### `FromResources` <a name="FromResources" id="cdktn.DynamicListTerraformIterator.fromResources" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.DynamicListTerraformIterator_FromResources(resource ITerraformResource) ResourceTerraformIterator
```

Creates a new iterator from a resource that has been created with the `for_each` argument.

#### `resource`<sup>Required</sup> <a name="resource" id="cdktn.DynamicListTerraformIterator.fromResources.parameter.resource" />

* *Type:* <a href="#cdktn.ITerraformResource">ITerraformResource</a>

***

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                            | **Type**                  | **Description**                                                              |
| ----------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------------------------------------- |
| <code><a href="#cdktn.DynamicListTerraformIterator.property.key">Key</a></code>     | <code>\*string</code>     | Returns the key of the current entry in the map that is being iterated over. |
| <code><a href="#cdktn.DynamicListTerraformIterator.property.value">Value</a></code> | <code>interface\{}</code> | Returns the value of the current item iterated over.                         |

***

### `Key`<sup>Required</sup> <a name="Key" id="cdktn.DynamicListTerraformIterator.property.key" />

```go theme={null}
func Key() *string
```

* *Type:* \*string

Returns the key of the current entry in the map that is being iterated over.

***

### `Value`<sup>Required</sup> <a name="Value" id="cdktn.DynamicListTerraformIterator.property.value" />

```go theme={null}
func Value() interface{}
```

* *Type:* interface\{}

Returns the value of the current item iterated over.

***
