Issue importing with CfnInclude when template do not have quotes
See original GitHub issueI encounter this issue when trying to import CloudFormation YAML Template to create IAM role.
The template have the following header: AWSTemplateFormatVersion: 2010-09-09 and also version with date Version: 2012-10-17.
The error I encounter is when trying to deploy the template to the AWS via CDK. The build is fine but when deploying I encounter the following error: failed: Error [ValidationError]: Template format error: unsupported value for AWSTemplateFormatVersion.
I noticed that the same template can be deploy via AWS CLI and validated without issue using: aws cloudformation create-stack --stack-name and aws cloudformation validate-template --template-body
I think this is a bug because AWS CLI have no issue with this why would deploying via CDK raises error.
Reproduction Steps
Deploying via CDK with any template with the above header would work that do not have quotes around the date.
What did you expect to happen?
it would throw an error failed: Error [ValidationError]: Template format error: unsupported value for AWSTemplateFormatVersion.
What actually happened?
failed: Error [ValidationError]: Template format error: unsupported value for AWSTemplateFormatVersion.
Environment
- CDK CLI Version :1.81.0
- Framework Version:
- Node.js Version:
- OS : MacOS
- Language (Version): Typescript
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thanks for the template @vincent851 . I can confirm I’m able to reproduce the problem. I have a guess what happens (the YAML library interprets
2010-09-09
as a Date instead of a String). I’m working on a fix.⚠️COMMENT VISIBILITY WARNING⚠️
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.