sparse-intern-71089
07/23/2020, 11:17 PMbored-terabyte-19735
08/07/2020, 9:34 AMbored-terabyte-19735
08/07/2020, 9:37 AMbored-terabyte-19735
08/07/2020, 9:39 AMimport {Certificate, CertificateValidation} from "@pulumi/aws/acm"
import {Record, getZone} from "@pulumi/aws/route53"
const selectedZone = output(getZone({
name: `... your zone name`,
privateZone: false,
},
{
async: true
}));
this.cert = new Certificate(`cert`, {
domainName: selectedZone.name.apply(zone => `...${zone}`),
validationMethod: "DNS",
});
this.certValidation = new Record("cert-validation", {
name: this.cert.domainValidationOptions[0].resourceRecordName,
records: [this.cert.domainValidationOptions[0].resourceRecordValue],
ttl: 60,
type: this.cert.domainValidationOptions[0].resourceRecordType,
zoneId: selectedZone.zoneId!,
},{
dependsOn: [this.cert]
});
this.certCertificateValidation = new CertificateValidation("cert", {
certificateArn: this.cert.arn,
validationRecordFqdns: [this.certValidation.fqdn],
}, {
dependsOn: [this.cert, this.certValidation]
});