https://pulumi.com logo
#python
Title
f

fresh-hospital-81544

05/04/2021, 12:17 AM
https://www.pulumi.com/docs/reference/pkg/aws/acm/certificatevalidation/ this line makes my head hurt 😅
Copy code
for range in [{"key": k, "value": v} for [k, v] in enumerate({dvo.domainName: {
    name: dvo.resourceRecordName,
    record: dvo.resourceRecordValue,
    type: dvo.resourceRecordType,
} for dvo in example_certificate.domainValidationOptions})]:
g

gorgeous-minister-41131

05/05/2021, 6:20 PM
Gotta love how the AWS API's inconsistencies and weirdness require a ton of workaround. 😂
f

fresh-hospital-81544

05/06/2021, 12:39 AM
I think in this case it is just a lazy transfer from the typescript version havent run it but maybe it should be more like
Copy code
record_generator = {dvo.domainName: {
    name: dvo.resourceRecordName,
    record: dvo.resourceRecordValue,
    type: dvo.resourceRecordType,
} for dvo in example_certificate.domainValidationOptions}

for k, v in record_generator.items():
    example_record.append(aws.route53.Record(f"exampleRecord-{v['key']}",
        allow_overwrite=True,
        name=v["value"]["name"],
        records=[v["value"]["record"]],
        ttl=60,
        type=v["value"]["type"],
        zone_id=example_zone.zone_id))