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

Standardize ".cfn" file extension for CloudFormation templates #45

Open
iainelder opened this issue Feb 5, 2022 · 4 comments
Open

Standardize ".cfn" file extension for CloudFormation templates #45

iainelder opened this issue Feb 5, 2022 · 4 comments
Labels
feature request Proposal for new features or requests

Comments

@iainelder
Copy link

Resource Name

Template files of all formats.

Details

From CloudFormation concepts:

A CloudFormation template is a JSON or YAML formatted text file. You can save these files with any extension, such as .json, .yaml, .template, or .txt.

The lack of a standard file extension makes it more difficult to configure tools like pre-commit to run checks such as cfn-lint only on CloudFormation files.

Current workarounds require you to use a file path filter to identify where the CloudFormation files are. This can get tricky when there are other JSON or YAML files in the project and when the CloudFormation files are stored in different places.

I propose ".cfn" as a standard file extension to make it easy to identify CloudFormation files.

This ought to be backwards compatible since the existing tooling can continue to accept files with any name and depend on the content instead.

See pre-commit/identify#281 for context.

@PatMyron
Copy link

.cfn.yaml would probably be better since it'd still be unique, but integrations without specific support for the new extension would still at least recognize it as YAML

@iainelder
Copy link
Author

I like it! So:

  • .cfn.yaml for templates in YAML format
  • .cfn.json for templates in JSON format

@lejiati
Copy link
Contributor

lejiati commented May 10, 2022

@iainelder Thank you very much for your feedback! Since this repository is focused on resource coverage, I'm transferring this issue over to a new GitHub repository dedicated to CloudFormation template language issues.

@lejiati lejiati transferred this issue from aws-cloudformation/cloudformation-coverage-roadmap May 10, 2022
@muneebar muneebar added feature request Proposal for new features or requests and removed enhancement New feature or request labels May 10, 2022
@lejiati lejiati removed the other label May 10, 2022
@drernie
Copy link

drernie commented Sep 9, 2022

I love the idea of ".cfn.yaml". That would make a lot of our automations much simpler.

And perhaps this is heretical, but this feels like a first step to treating the "Cloud Formation template language" as its own first-class programming language (CFTL?), which just happens to have a built-in module for managing AWS resources...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Proposal for new features or requests
Projects
None yet
Development

No branches or pull requests

7 participants