Closed surecloud-meason closed 1 year ago
Thanks for reporting this @surecloud-meason, I was able to reproduce this.
I'm pretty stumped why this is occurring. Everything in the template is formatted correctly, there should be no validation errors occurring here.
I've created a ticket for CloudFormation (P75318355), hopefully they'll be able to help out here. I'll let you know if there are any updates. Thanks!
Ah, the issue is due to the result of the output HostedZone.NameServers
being a list of strings. Here is how the template could look instead:
Outputs:
HZNameServer:
Value: !Join ["", !GetAtt myHostedZone.NameServers]
You could work around this for now by creating your own CfnOutput and referencing it directly in the other stack when needed
Is this still an issue? Pretty sure this has been fixed by #22873
Yeah we can probably close this, I tested this prior to the change linked
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
@peterwoodworth I just hit this with the latest version of CDK (2.147.2 (build f4b0897)) FYI. Basically the same setup - create a hosted zone in my main stack and trying to reference .hostedZoneNameServers when creating a ZoneDelegationRecord
in another Stack.
As you can see in the docs @kbrownlees, it says that it will be undefined if its imported from another stack.
I wish this was different, because It feels pretty dumb.
Describe the bug
When referencing a HostedZoneNameServer from another stack the Output created is invalid and on deployment errors with: "Template format error: Every Value member must be a string."
CDK Synth Cloudformation Snippet Generated:
Expected Behavior
The auto created output handles lists correctly for use within another stack.
Current Behavior
The deploy fails due to an cloudformation format error .
Reproduction Steps
DNS Stack:
Stack Referencing the above stack
Stack Instantiations
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.50.0
Framework Version
No response
Node.js Version
v16.18.0
OS
Ubuntu 20.04
Language
Typescript
Language Version
No response
Other information
No response