question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue importing with CfnInclude when template do not have quotes

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
skinny85commented, Mar 22, 2021

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.

0reactions
github-actions[bot]commented, Mar 30, 2021

⚠️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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import or migrate an existing AWS CloudFormation template
The cloudformation-include.CfnInclude construct converts the resources in an imported AWS CloudFormation template to AWS CDK L1 constructs. You can work ...
Read more >
awslabs/aws-cdk - Gitter
I have a security group which has all my rds instances in it. I want to add a lambda that can talk to...
Read more >
Importing existing CloudFormation resources into CDK at scale
The CfnInclude construct "imports" resources from an existing CloudFormation template file. The resulting CDK construct is a collection of ...
Read more >
How to Provide Parameters to CfnInclude with CDK
When using CfnInclude, it's possible to provide parameters to a Cloudformation YAML file. This guide walks through how to do that.
Read more >
Resource Importing - AWS CloudFormation Workshop
You are tasked with solving the following issue: one of the resources in a CloudFormation template, an EC2 instance, has a property value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found