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
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.NewResourceTerraformIterator(element ITerraformResource) ResourceTerraformIterator
| Name | Type | Description |
|---|
element | ITerraformResource | No description. |
elementRequired
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
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://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributesRequired
- Type: *map[string]interface{}
ForExpressionForList
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.
expressionRequired
The expression to use in the for mapping.
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.
keyExpressionRequired
The expression to use as key in the for mapping.
valueExpressionRequired
The expression to use as value in the for mapping.
GetAny
func GetAny(attribute *string) IResolvable
attributeRequired
name of the property to retrieve.
GetAnyMap
func GetAnyMap(attribute *string) *map[string]interface{}
attributeRequired
name of the property to retrieve.
GetBoolean
func GetBoolean(attribute *string) IResolvable
attributeRequired
name of the property to retrieve.
GetBooleanMap
func GetBooleanMap(attribute *string) *map[string]*bool
attributeRequired
name of the property to retrieve.
GetList
func GetList(attribute *string) *[]*string
attributeRequired
name of the property to retrieve.
GetMap
func GetMap(attribute *string) *map[string]interface{}
attributeRequired
name of the property to retrieve.
GetNumber
func GetNumber(attribute *string) *f64
attributeRequired
name of the property to retrieve.
GetNumberList
func GetNumberList(attribute *string) *[]*f64
attributeRequired
name of the property to retrieve.
GetNumberMap
func GetNumberMap(attribute *string) *map[string]*f64
attributeRequired
name of the property to retrieve.
GetString
func GetString(attribute *string) *string
attributeRequired
name of the property to retrieve.
GetStringMap
func GetStringMap(attribute *string) *map[string]*string
attributeRequired
name of the property to retrieve.
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
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.
propertyRequired
The property of the iterators values to map to.
Values
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
| 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
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.ResourceTerraformIterator_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
// 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,
})
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
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.ResourceTerraformIterator_FromDataSources(resource ITerraformResource) ResourceTerraformIterator
Creates a new iterator from a data source that has been created with the for_each argument.
resourceRequired
FromList
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.ResourceTerraformIterator_FromList(list interface{}) ListTerraformIterator
Creates a new iterator from a list.
listRequired
FromMap
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.ResourceTerraformIterator_FromMap(map interface{}) MapTerraformIterator
Creates a new iterator from a map.
mapRequired
FromResources
import "github.com/open-constructs/cdk-terrain-go/cdktn"
cdktn.ResourceTerraformIterator_FromResources(resource ITerraformResource) ResourceTerraformIterator
Creates a new iterator from a resource that has been created with the for_each argument.
resourceRequired
Properties
| Name | Type | Description |
|---|
Key | interface{} | Returns the current entry in the list or set that is being iterated over. |
Value | interface{} | Returns the value of the current item iterated over. |
KeyRequired
Returns the current 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
Returns the value of the current item iterated over.