> ## 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.

# CSharp: MapTerraformIterator

> CDKTN Core API Reference for MapTerraformIterator in CSharp.

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

```csharp theme={null}
using Io.Cdktn;

new MapTerraformIterator(AnyMap|StringMap|NumberMap|BooleanMap|ComplexMap|System.Collections.Generic.IDictionary<string, object>|System.Collections.Generic.IDictionary<string, string>|System.Collections.Generic.IDictionary<string, double> Map);
```

| **Name**                                                                             | **Type**                                                                                                                                                                                                                                                                                                                                                                                                     | **Description**   |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| <code><a href="#cdktn.MapTerraformIterator.Initializer.parameter.map">Map</a></code> | <code><a href="#cdktn.AnyMap">AnyMap</a>\|<a href="#cdktn.StringMap">StringMap</a>\|<a href="#cdktn.NumberMap">NumberMap</a>\|<a href="#cdktn.BooleanMap">BooleanMap</a>\|<a href="#cdktn.ComplexMap">ComplexMap</a>\|System.Collections.Generic.IDictionary\< string, object >\|System.Collections.Generic.IDictionary\< string, string >\|System.Collections.Generic.IDictionary\< string, double ></code> | *No description.* |

***

### `Map`<sup>Required</sup> <a name="Map" id="cdktn.MapTerraformIterator.Initializer.parameter.map" />

* *Type:* <a href="#cdktn.AnyMap">AnyMap</a>|<a href="#cdktn.StringMap">StringMap</a>|<a href="#cdktn.NumberMap">NumberMap</a>|<a href="#cdktn.BooleanMap">BooleanMap</a>|<a href="#cdktn.ComplexMap">ComplexMap</a>|System.Collections.Generic.IDictionary\< string, object >|System.Collections.Generic.IDictionary\< string, string >|System.Collections.Generic.IDictionary\< string, double >

***

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

| **Name**                                                                                         | **Description**                                                                              |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.MapTerraformIterator.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.MapTerraformIterator.forExpressionForList">ForExpressionForList</a></code> | Creates a for expression that results in a list.                                             |
| <code><a href="#cdktn.MapTerraformIterator.forExpressionForMap">ForExpressionForMap</a></code>   | Creates a for expression that results in a map.                                              |
| <code><a href="#cdktn.MapTerraformIterator.getAny">GetAny</a></code>                             | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getAnyMap">GetAnyMap</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getBoolean">GetBoolean</a></code>                     | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getBooleanMap">GetBooleanMap</a></code>               | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getList">GetList</a></code>                           | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getMap">GetMap</a></code>                             | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getNumber">GetNumber</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getNumberList">GetNumberList</a></code>               | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getNumberMap">GetNumberMap</a></code>                 | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getString">GetString</a></code>                       | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.getStringMap">GetStringMap</a></code>                 | *No description.*                                                                            |
| <code><a href="#cdktn.MapTerraformIterator.keys">Keys</a></code>                                 | Creates a for expression that maps the iterators to its keys.                                |
| <code><a href="#cdktn.MapTerraformIterator.pluckProperty">PluckProperty</a></code>               | Creates a for expression that accesses the key on each element of the iterator.              |
| <code><a href="#cdktn.MapTerraformIterator.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.MapTerraformIterator.dynamic" />

```csharp theme={null}
private IResolvable Dynamic(System.Collections.Generic.IDictionary<string, object> Attributes)
```

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.MapTerraformIterator.dynamic.parameter.attributes" />

* *Type:* System.Collections.Generic.IDictionary\< string, object >

***

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

```csharp theme={null}
private IResolvable ForExpressionForList(string|IResolvable Expression)
```

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.MapTerraformIterator.forExpressionForList.parameter.expression" />

* *Type:* string|<a href="#cdktn.IResolvable">IResolvable</a>

The expression to use in the for mapping.

***

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

```csharp theme={null}
private IResolvable ForExpressionForMap(string|IResolvable KeyExpression, string|IResolvable ValueExpression)
```

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.MapTerraformIterator.forExpressionForMap.parameter.keyExpression" />

* *Type:* string|<a href="#cdktn.IResolvable">IResolvable</a>

The expression to use as key in the for mapping.

***

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

* *Type:* string|<a href="#cdktn.IResolvable">IResolvable</a>

The expression to use as value in the for mapping.

***

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

```csharp theme={null}
private IResolvable GetAny(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private System.Collections.Generic.IDictionary<string, object> GetAnyMap(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private IResolvable GetBoolean(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private System.Collections.Generic.IDictionary<string, bool> GetBooleanMap(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private string[] GetList(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private System.Collections.Generic.IDictionary<string, object> GetMap(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private double GetNumber(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private double[] GetNumberList(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private System.Collections.Generic.IDictionary<string, double> GetNumberMap(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private string GetString(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private System.Collections.Generic.IDictionary<string, string> GetStringMap(string Attribute)
```

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

* *Type:* string

name of the property to retrieve.

***

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

```csharp theme={null}
private IResolvable Keys()
```

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.MapTerraformIterator.pluckProperty" />

```csharp theme={null}
private IResolvable PluckProperty(string Property)
```

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.MapTerraformIterator.pluckProperty.parameter.property" />

* *Type:* string

The property of the iterators values to map to.

***

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

```csharp theme={null}
private IResolvable Values()
```

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.MapTerraformIterator.fromComplexList">FromComplexList</a></code> | Creates a new iterator from a complex list.                                                   |
| <code><a href="#cdktn.MapTerraformIterator.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.MapTerraformIterator.fromList">FromList</a></code>               | Creates a new iterator from a list.                                                           |
| <code><a href="#cdktn.MapTerraformIterator.fromMap">FromMap</a></code>                 | Creates a new iterator from a map.                                                            |
| <code><a href="#cdktn.MapTerraformIterator.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.MapTerraformIterator.fromComplexList" />

```csharp theme={null}
using Io.Cdktn;

MapTerraformIterator.FromComplexList(IResolvable|ComplexList|StringMapList|NumberMapList|BooleanMapList|AnyMapList List, string MapKeyAttributeName);
```

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*

```csharp theme={null}
// Example automatically generated from non-compiling source. May contain errors.
var cert = new AcmCertificate(this, "cert", new Struct {
    DomainName = "example.com",
    ValidationMethod = "DNS"
});

var dvoIterator = TerraformIterator.FromComplexList(cert.DomainValidationOptions, "domain_name");

new Route53Record(this, "record", new Struct {
    AllowOverwrite = true,
    Name = dvoIterator.GetString("name"),
    Records = new [] { dvoIterator.GetString("record") },
    Ttl = 60,
    Type = dvoIterator.GetString("type"),
    ZoneId = Token.AsString(dataAwsRoute53ZoneExample.ZoneId),
    ForEach = dvoIterator
});
```

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

* *Type:* <a href="#cdktn.IResolvable">IResolvable</a>|<a href="#cdktn.ComplexList">ComplexList</a>|<a href="#cdktn.StringMapList">StringMapList</a>|<a href="#cdktn.NumberMapList">NumberMapList</a>|<a href="#cdktn.BooleanMapList">BooleanMapList</a>|<a href="#cdktn.AnyMapList">AnyMapList</a>

the list to iterate over.

***

#### `MapKeyAttributeName`<sup>Required</sup> <a name="MapKeyAttributeName" id="cdktn.MapTerraformIterator.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.MapTerraformIterator.fromDataSources" />

```csharp theme={null}
using Io.Cdktn;

MapTerraformIterator.FromDataSources(ITerraformResource Resource);
```

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.MapTerraformIterator.fromDataSources.parameter.resource" />

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

***

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

```csharp theme={null}
using Io.Cdktn;

MapTerraformIterator.FromList(string[]|IResolvable|double[]|(bool|IResolvable)[] List);
```

Creates a new iterator from a list.

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

* *Type:* string\[]|<a href="#cdktn.IResolvable">IResolvable</a>|double\[]|bool|<a href="#cdktn.IResolvable">IResolvable</a>\[]

***

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

```csharp theme={null}
using Io.Cdktn;

MapTerraformIterator.FromMap(ComplexMap|System.Collections.Generic.IDictionary<string, object>|System.Collections.Generic.IDictionary<string, string>|System.Collections.Generic.IDictionary<string, double>|System.Collections.Generic.IDictionary<string, bool> Map);
```

Creates a new iterator from a map.

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

* *Type:* <a href="#cdktn.ComplexMap">ComplexMap</a>|System.Collections.Generic.IDictionary\< string, object >|System.Collections.Generic.IDictionary\< string, string >|System.Collections.Generic.IDictionary\< string, double >|System.Collections.Generic.IDictionary\< string, bool >

***

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

```csharp theme={null}
using Io.Cdktn;

MapTerraformIterator.FromResources(ITerraformResource Resource);
```

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.MapTerraformIterator.fromResources.parameter.resource" />

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

***

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

| **Name**                                                                    | **Type**            | **Description**                                                              |
| --------------------------------------------------------------------------- | ------------------- | ---------------------------------------------------------------------------- |
| <code><a href="#cdktn.MapTerraformIterator.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.MapTerraformIterator.property.value">Value</a></code> | <code>object</code> | Returns the value of the current item iterated over.                         |

***

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

```csharp theme={null}
public string Key { get; }
```

* *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.MapTerraformIterator.property.value" />

```csharp theme={null}
public object Value { get; }
```

* *Type:* object

Returns the value of the current item iterated over.

***
