-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Computed Lists and Maps #42
Comments
Maybe related: #796 We can't use the technique described in above PR const awsRoute53RecordExample = new aws.Route53Record(this, "example", {
allowOverwrite: true,
name: "${each.value.name}",
records: ["${each.value.record}"],
ttl: 60,
type: "${each.value.type}",
zoneId: dataAwsRoute53Zone.example.zoneId,
});
awsRoute53RecordAwsRoute53RecordExample.addOverride(
"for_each",
`\${{
for dvo in ${awsAcmCertificateExample.domainValidationOptions} : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
}
}}`
); bacause To achieve getting the proper interface, we should take care about unawareness of number of items by cdk side (cdk is just a static HCL generator). That's why we can't use array/map/object for this. Thus I want to suggest iterable like signature. awsAcmCertificateExample.domainValidationOptions.entries().map((([_key, value]) => {
return [value.domainName, {name: value.resourceRecordName, /* ... */}];
})).fromEntries() Maybe at least what we want are In some cases, for example Making it dynamic is charming, but it looks hard. I think iterator like interface is good compromise for now. I believe it's possible solution. If you like this and nobody will implement, I want to tackle implementing this next months. |
We can consider special mapper like |
|
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
With the current implementation of computed Lists and Maps we can access single elements (see #31 / #12). What we can't do right now:
The text was updated successfully, but these errors were encountered: