Skip to content

Commit

Permalink
fix(docs): fix complex iterator example (#3410)
Browse files Browse the repository at this point in the history
Resolves #3409
  • Loading branch information
ansgarm authored Jan 11, 2024
1 parent 7a66f97 commit 2b3ac20
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions examples/csharp/documentation/IteratorStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ public IteratorStack(Construct scope, string name) : base(scope, name)
{
ForEach = exampleForEachIterator,
AllowOverwrite = true,
Name = exampleForEachIterator.GetString("name"),
Records = new string[] { exampleForEachIterator.GetString("record") },
Name = exampleForEachIterator.GetString("resource_record_name"),
Records = new string[] { exampleForEachIterator.GetString("resource_record_record") },
Ttl = 60,
Type = exampleForEachIterator.GetString("type"),
Type = exampleForEachIterator.GetString("resource_record_type"),
ZoneId = dataAwsRoute53ZoneExample.ZoneId
});

Expand Down
6 changes: 3 additions & 3 deletions examples/go/documentation/iterators.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ func NewIteratorsStack(scope constructs.Construct, name string) cdktf.TerraformS
records := route53record.NewRoute53Record(stack, jsii.String("record"), &route53record.Route53RecordConfig{
ForEach: exampleForEachIterator,
AllowOverwrite: jsii.Bool(true),
Name: exampleForEachIterator.GetString(jsii.String("name")),
Records: jsii.Strings(*exampleForEachIterator.GetString(jsii.String("record"))),
Name: exampleForEachIterator.GetString(jsii.String("resource_record_name")),
Records: jsii.Strings(*exampleForEachIterator.GetString(jsii.String("resource_record_record"))),
Ttl: jsii.Number(60),
Type: exampleForEachIterator.GetString(jsii.String("type")),
Type: exampleForEachIterator.GetString(jsii.String("resource_record_type")),
ZoneId: dataAwsRoute53ZoneExample.ZoneId(),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public MainIterator2(Construct scope, String id) {
Route53Record records = new Route53Record(this, "record", Route53RecordConfig.builder()
.forEach(exampleForEachIterator)
.allowOverwrite(true)
.name(exampleForEachIterator.getString("name"))
.records(Arrays.asList(exampleForEachIterator.getString("record")))
.name(exampleForEachIterator.getString("resource_record_name"))
.records(Arrays.asList(exampleForEachIterator.getString("resource_record_record")))
.ttl(60)
.type(exampleForEachIterator.getString("type"))
.type(exampleForEachIterator.getString("resource_record_type"))
.zoneId(dataAwsRoute53ZoneExample.getZoneId())
.build());

Expand Down
6 changes: 3 additions & 3 deletions examples/python/documentation/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ def __init__(self, scope: Construct, id: str):
for_each=example_for_each_iterator,
allow_overwrite=True,
name=example_for_each_iterator.get_string(
"name"),
"resource_record_name"),
records=[
example_for_each_iterator.get_string("record")],
example_for_each_iterator.get_string("resource_record_record")],
ttl=60,
type=example_for_each_iterator.get_string(
"type"),
"resource_record_type"),
zone_id=data_aws_route53_zone_example.zone_id,
)

Expand Down
6 changes: 3 additions & 3 deletions examples/typescript/documentation/iterators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ export class IteratorsStack extends TerraformStack {
const records = new Route53Record(this, "record", {
forEach: exampleForEachIterator,
allowOverwrite: true,
name: exampleForEachIterator.getString("name"),
records: [exampleForEachIterator.getString("record")],
name: exampleForEachIterator.getString("resource_record_name"),
records: [exampleForEachIterator.getString("resource_record_record")],
ttl: 60,
type: exampleForEachIterator.getString("type"),
type: exampleForEachIterator.getString("resource_record_type"),
zoneId: dataAwsRoute53ZoneExample.zoneId,
});

Expand Down
30 changes: 15 additions & 15 deletions website/docs/cdktf/concepts/iterators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ const exampleForEachIterator = TerraformIterator.fromComplexList(
const records = new Route53Record(this, "record", {
forEach: exampleForEachIterator,
allowOverwrite: true,
name: exampleForEachIterator.getString("name"),
records: [exampleForEachIterator.getString("record")],
name: exampleForEachIterator.getString("resource_record_name"),
records: [exampleForEachIterator.getString("resource_record_record")],
ttl: 60,
type: exampleForEachIterator.getString("type"),
type: exampleForEachIterator.getString("resource_record_type"),
zoneId: dataAwsRoute53ZoneExample.zoneId,
});

Expand Down Expand Up @@ -355,12 +355,12 @@ new AcmCertificateValidation(this, "validation", {
for_each=example_for_each_iterator,
allow_overwrite=True,
name=example_for_each_iterator.get_string(
"name"),
"resource_record_name"),
records=[
example_for_each_iterator.get_string("record")],
example_for_each_iterator.get_string("resource_record_record")],
ttl=60,
type=example_for_each_iterator.get_string(
"type"),
"resource_record_type"),
zone_id=data_aws_route53_zone_example.zone_id,
)

Expand Down Expand Up @@ -394,10 +394,10 @@ new AcmCertificateValidation(this, "validation", {
Route53Record records = new Route53Record(this, "record", Route53RecordConfig.builder()
.forEach(exampleForEachIterator)
.allowOverwrite(true)
.name(exampleForEachIterator.getString("name"))
.records(Arrays.asList(exampleForEachIterator.getString("record")))
.name(exampleForEachIterator.getString("resource_record_name"))
.records(Arrays.asList(exampleForEachIterator.getString("resource_record_record")))
.ttl(60)
.type(exampleForEachIterator.getString("type"))
.type(exampleForEachIterator.getString("resource_record_type"))
.zoneId(dataAwsRoute53ZoneExample.getZoneId())
.build());

Expand Down Expand Up @@ -430,10 +430,10 @@ new AcmCertificateValidation(this, "validation", {
{
ForEach = exampleForEachIterator,
AllowOverwrite = true,
Name = exampleForEachIterator.GetString("name"),
Records = new string[] { exampleForEachIterator.GetString("record") },
Name = exampleForEachIterator.GetString("resource_record_name"),
Records = new string[] { exampleForEachIterator.GetString("resource_record_record") },
Ttl = 60,
Type = exampleForEachIterator.GetString("type"),
Type = exampleForEachIterator.GetString("resource_record_type"),
ZoneId = dataAwsRoute53ZoneExample.ZoneId
});

Expand Down Expand Up @@ -462,10 +462,10 @@ exampleForEachIterator := cdktf.TerraformIterator_FromComplexList(cert.DomainVal
records := route53record.NewRoute53Record(stack, jsii.String("record"), &route53record.Route53RecordConfig{
ForEach: exampleForEachIterator,
AllowOverwrite: jsii.Bool(true),
Name: exampleForEachIterator.GetString(jsii.String("name")),
Records: jsii.Strings(*exampleForEachIterator.GetString(jsii.String("record"))),
Name: exampleForEachIterator.GetString(jsii.String("resource_record_name")),
Records: jsii.Strings(*exampleForEachIterator.GetString(jsii.String("resource_record_record"))),
Ttl: jsii.Number(60),
Type: exampleForEachIterator.GetString(jsii.String("type")),
Type: exampleForEachIterator.GetString(jsii.String("resource_record_type")),
ZoneId: dataAwsRoute53ZoneExample.ZoneId(),
})

Expand Down

0 comments on commit 2b3ac20

Please sign in to comment.