Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-ec2): Empty content InitFile fails in CloudFormation #13009

Closed
mina-asham opened this issue Feb 12, 2021 · 1 comment
Closed

(aws-ec2): Empty content InitFile fails in CloudFormation #13009

mina-asham opened this issue Feb 12, 2021 · 1 comment
Assignees
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md needs-triage This issue or PR still needs to be triaged. p2

Comments

@mina-asham
Copy link
Contributor

This is not really a bug I would say but more of a missing validation, I tried to create a marker file with CfnInit:

InitFile.fromString(fileName, "");

But when cfn-init ran on the host I got:

2021-02-12 09:19:52,491 [ERROR] Error encountered during build of REDACTED_CONFIG_NAME: File specified without source or content

It looks like this is not allowed in CloudFormation (not ideal but fine), so we should add some validation for the InitFile on the content (I realize this is might not possible for ALL types, e.g. S3, but still worth it for simple ones)

Reproduction Steps

Trying to add an empty InitFile using any way

What did you expect to happen?

Getting a failure during synth instead of waiting till I actually deploy.

What actually happened?

Environment

  • CDK CLI Version : 1.88.0
  • Framework Version: 1.88.0
  • Node.js Version: Irrelevant
  • OS : Irrelevant
  • Language (Version): Irrelevant

Other


This is 🐛 Bug Report

@mina-asham mina-asham added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 12, 2021
@github-actions github-actions bot added the @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud label Feb 12, 2021
@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2 labels Feb 15, 2021
mergify bot pushed a commit that referenced this issue Feb 26, 2021
Validate InitFile content to catch error during synth instead of deploy. Fixes issue #13009 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@rix0rrr rix0rrr closed this as completed Mar 1, 2021
@github-actions
Copy link

github-actions bot commented Mar 1, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud bug This issue is a bug. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md needs-triage This issue or PR still needs to be triaged. p2
Projects
None yet
Development

No branches or pull requests

2 participants