sparse-intern-71089
05/25/2023, 11:47 AMsalmon-account-74572
05/25/2023, 4:23 PMflaky-finland-22550
05/26/2023, 9:58 AMflaky-finland-22550
05/26/2023, 10:05 AMsalmon-account-74572
05/26/2023, 7:00 PMflaky-finland-22550
05/30/2023, 7:41 AMdelightful-salesclerk-16161
flaky-finland-22550
05/30/2023, 8:20 PMflaky-finland-22550
06/01/2023, 10:34 AMsalmon-account-74572
06/05/2023, 2:58 PMflaky-finland-22550
06/05/2023, 3:04 PMconst environment = pulumi.getStack();
const commonStack = new pulumi.StackReference(`example/${environment}`);
const subDNS = commonStack.getOutput("dns").apply((t) => {
return {
domainName: t.domainName as string,
nameServers: t.nameServers as string[]
};
});
After that, I set the credentials for the production account and exported it (for local testing).
I then retrieved the hosted zone from the production account.
const parentHostedZone = aws.route53.getZone({ name: exampleDomainName, privateZone: false });
After that, I created a Route53 record and passed the domainName and nameServers I had referenced from the other stack, and the zoneId of the production hosted zone
export const subdomainRecord = new aws.route53.Record(`${environment}-subdomain-record`, {
allowOverwrite: true,
name: subDNS.domainName,
type: "NS",
ttl: 300,
records: subDNS.nameServers,
zoneId: parentHostedZone.then(zr => zr.zoneId)
}, { protect: false });
salmon-account-74572
06/05/2023, 3:09 PMflaky-finland-22550
06/05/2023, 3:10 PMsalmon-account-74572
06/05/2023, 3:11 PM