I am using the CDK to create a public Route53 zone:
const externalRoute53Zone = new Route53Zone(this, 'externalRoute53Zone', {
name: cfg.externalDomainName,
});
One created, I’d like to retrieve the name servers created, and print them to the screen (actually log to a file but am using console.log()
for demonstration purposes.
I don’t understand how to get these to display. For example, I’ve done:
console.log(externalRoute53Zone.nameServers);
console.log(Token.asString(externalRoute53Zone.nameServers);
console.log(new TerraformOutput(this, 'nameServers', {
value: externalRoute53Zone.nameServers
}));
The above attempts result in:
[ '#{Token[TOKEN.2]}' ]
<ref *1> TerraformOutput {
rawOverrides: {},
stack: MyStack {
rawOverrides: {},
artifactFile: 'cdk.tf.json',
cdktfVersion: '0.0.17',
[Symbol(@aws-cdk/core.DependableTrait)]: { dependencyRoots: [Array] }
},
value: [ '#{Token[TOKEN.3]}' ],
description: undefined,
sensitive: undefined,
dependsOn: undefined,
[Symbol(@aws-cdk/core.DependableTrait)]: { dependencyRoots: [ [Circular *1] ] }
}
I’m hoping to get back an array or anything I can parse, example:
name_servers = [
"ns-123.awsdns-57.org",
"ns-234.awsdns-19.com",
"ns-567.awsdns-15.co.uk",
"ns-890.awsdns-08.net",
]
Any help would be appreciated!