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.
Initializers
using Io.Cdktn;
new ListTerraformIterator(string[]|IResolvable|double[]|(bool|IResolvable)[] List);
| Name | Type | Description |
|---|
List | string[]|IResolvable|double[]|bool|IResolvable[] | No description. |
ListRequired
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
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://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
AttributesRequired
- Type: System.Collections.Generic.IDictionary< string, object >
ForExpressionForList
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.
ExpressionRequired
The expression to use in the for mapping.
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.
KeyExpressionRequired
The expression to use as key in the for mapping.
ValueExpressionRequired
The expression to use as value in the for mapping.
GetAny
private IResolvable GetAny(string Attribute)
AttributeRequired
name of the property to retrieve.
GetAnyMap
private System.Collections.Generic.IDictionary<string, object> GetAnyMap(string Attribute)
AttributeRequired
name of the property to retrieve.
GetBoolean
private IResolvable GetBoolean(string Attribute)
AttributeRequired
name of the property to retrieve.
GetBooleanMap
private System.Collections.Generic.IDictionary<string, bool> GetBooleanMap(string Attribute)
AttributeRequired
name of the property to retrieve.
GetList
private string[] GetList(string Attribute)
AttributeRequired
name of the property to retrieve.
GetMap
private System.Collections.Generic.IDictionary<string, object> GetMap(string Attribute)
AttributeRequired
name of the property to retrieve.
GetNumber
private double GetNumber(string Attribute)
AttributeRequired
name of the property to retrieve.
GetNumberList
private double[] GetNumberList(string Attribute)
AttributeRequired
name of the property to retrieve.
GetNumberMap
private System.Collections.Generic.IDictionary<string, double> GetNumberMap(string Attribute)
AttributeRequired
name of the property to retrieve.
GetString
private string GetString(string Attribute)
AttributeRequired
name of the property to retrieve.
GetStringMap
private System.Collections.Generic.IDictionary<string, string> GetStringMap(string Attribute)
AttributeRequired
name of the property to retrieve.
Keys
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
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.
PropertyRequired
The property of the iterators values to map to.
Values
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
| 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
using Io.Cdktn;
ListTerraformIterator.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
// 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
});
ListRequired
the list to iterate over.
MapKeyAttributeNameRequired
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
FromDataSources
using Io.Cdktn;
ListTerraformIterator.FromDataSources(ITerraformResource Resource);
Creates a new iterator from a data source that has been created with the for_each argument.
ResourceRequired
FromList
using Io.Cdktn;
ListTerraformIterator.FromList(string[]|IResolvable|double[]|(bool|IResolvable)[] List);
Creates a new iterator from a list.
ListRequired
FromMap
using Io.Cdktn;
ListTerraformIterator.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.
MapRequired
- Type: 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 >
FromResources
using Io.Cdktn;
ListTerraformIterator.FromResources(ITerraformResource Resource);
Creates a new iterator from a resource that has been created with the for_each argument.
ResourceRequired
Properties
| Name | Type | Description |
|---|
Key | object | Returns the currently entry in the list or set that is being iterated over. |
Value | object | Returns the value of the current item iterated over. |
KeyRequired
public object Key { get; }
Returns the currently entry in the list or set that is being iterated over.
For lists this is the same as iterator.value. If you need the index,
use count via TerraformCount:
https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-count
ValueRequired
public object Value { get; }
Returns the value of the current item iterated over.