late-balloon-24601
05/29/2024, 3:54 PMlate-balloon-24601
05/29/2024, 3:55 PMclass DnsValidatedCertificate extends pulumi.ComponentResource {
certificate: aws.acm.Certificate
constructor (name: string, props: DnsValidatedCertificateProps, opts?: pulumi.ComponentResourceOptions) {
super('pkg:index:DnsValidatedCertificate', name, props, opts)
this.certificate = new aws.acm.Certificate('certificate', props, { parent: this })
const records: aws.route53.Record[] = []
this.certificate.domainValidationOptions.apply((domainValidationOpts) => {
for (const [i, domainValidationOpt] of domainValidationOpts.entries()) {
records.push(new aws.route53.Record(`certificate-validation-record-${i}`, {
allowOverwrite: true,
zoneId: props.zoneId,
name: domainValidationOpt.resourceRecordName,
type: domainValidationOpt.resourceRecordType,
records: [domainValidationOpt.resourceRecordValue],
ttl: 60
}, { parent: this }))
}
})
new aws.acm.CertificateValidation('certificate-validation', {
certificateArn: this.certificate.arn,
validationRecordFqdns: records.map(record => record.fqdn)
}, { parent: this })
}
}
and the two resources in my program:
this.certificate = new DnsValidatedCertificate('certificate', {
domainName: props.dns.domainToDelegate,
subjectAlternativeNames: [`*.${props.dns.domainToDelegate}`],
validationMethod: 'DNS',
zoneId: this.route53Zone.zoneId
}, { parent: this }).certificate
this.certificateUsEast1 = new DnsValidatedCertificate('certificate-us-east-1', {
domainName: props.dns.domainToDelegate,
subjectAlternativeNames: [`*.${props.dns.domainToDelegate}`],
validationMethod: 'DNS',
zoneId: this.route53Zone.zoneId
}, { parent: this, provider: usEast1Provider }).certificate
I find it odd that Pulumi is complaining about the second cert having the same URN as the first, which implies I should be embedding the logical name I pass to the DnsValidatedCertificate
constructor into the child resourceslate-balloon-24601
05/29/2024, 4:00 PMsuper('pkg:index:DnsValidatedCertificate:' + name, name, props, opts)
dry-keyboard-94795
05/29/2024, 4:03 PMlate-balloon-24601
05/29/2024, 4:05 PMdry-keyboard-94795
05/29/2024, 4:10 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by