# typescript
Copy code
const exampleRecord: aws.route53.Record[];
for (const range of Object.entries(exampleCertificate.domainValidationOptions.apply(domainValidationOptions => domainValidationOptions.reduce((__obj, dvo) => { ...__obj, [dvo.domainName]: {
    name: dvo.resourceRecordName,
    record: dvo.resourceRecordValue,
    type: dvo.resourceRecordType,
} }))).map(([k, v]) => {key: k, value: v})) {
    exampleRecord.push(new aws.route53.Record(`exampleRecord-${range.key}`, {
        allowOverwrite: true,
        name: range.value.name,
        records: [range.value.record],
        ttl: 60,
        type: range.value.type,
        zoneId: exampleZone.then(exampleZone => exampleZone.zoneId),
Hi, typescript noob so bear with me. The above code is copy+paste from the docs and it gives a lot of compiler errors. does anyone know how it should be? Thanks
Wow that's not idiomatic at all...
I don't know what it's supposed to be doing, so maybe we could address it one compiler issue at a time?
One thing that jumps out at me is
exampleZone.then(exampleZone => exampleZone.zoneId)
, which should be
Is the aim to enable certificate validation using Route53 to write the CNAME record? I did this a few days ago, it's not as hard as the example makes it look...
You can rely on the fact that ACM returns exactly one validation record.
Here's my code, edited for sharing (and not run in its edited form, so beware of typos):
Ok cool. Thanks! Glad it's not only me thinking that (the python version is similarly hard to follow and not valid code) Now I can compile but AWS is complaining about
for the
despite 1000 limit and no active certs. I will report back once I've resolved that issue
✔️ 1
gave up on AWS and used lets encrypt instead. works great using this example https://github.com/pulumi/cert-manager-examples/tree/master/examples/letsencrypt
Good stuff. Let's Encrypt has some advantages, especially in the area of getting the cert onto a specific machine.