dry-football-2639
10/05/2021, 12:49 PMasync/await
operations inside the ComponentResource constructor (like resource getters)? If I can't do await
in the constructor, can I ever be sure that Pulumi will respect the dependency order (that the resources I pass as dependencies will be properly awaited before constructing the resource)?
class DelegatedPublicDnsZone extends pulumi.ComponentResource {
public output: DnsZone
constructor(
name: string,
args: DelegatedPublicDnsZoneArgs,
opts: pulumi.ComponentResourceOptions = {}
) {
super('dixa:iac:DnsZone', name, {}, opts)
const { zone, getConventionName } = args
if (zone.id) {
const r53Zone = await aws.route53.getZone({ <--- await cannon be used in constructor
zoneId: zone.id,
})
this.output = {
id: pulumi.output(r53Zone.id),
domainName: pulumi.output(r53Zone.name),
}
}
curved-pharmacist-41509
10/05/2021, 12:54 PMechoing-actor-55539
10/06/2021, 12:43 AMexport const siteZone = aws.route53.Zone.get(
'siteZone',
aws.route53.getZone(
{ name: '<http://my.zone.com|my.zone.com>', privateZone: false }
).then(zone => zone.id),
{}
);