cfn-language-discussion
cfn-language-discussion copied to clipboard
Standardize ".cfn" file extension for CloudFormation templates
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 https://github.com/pre-commit/identify/issues/281 for context.
.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
I like it! So:
-
.cfn.yaml
for templates in YAML format -
.cfn.json
for templates in JSON format
@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.
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...