Repository navigation
adds capability to resolve anchors and aliases in yaml in aws cloudformation package - #3462
Closed
shortjared wants to merge 1 commit into
Closed
shortjared wants to merge 1 commit into
shortjared wants to merge 1 commit into
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3462 +/- ##
===========================================
+ Coverage 94.54% 94.54% +<.01%
===========================================
Files 174 174
Lines 13395 13398 +3
===========================================
+ Hits 12664 12667 +3
Misses 731 731
Continue to review full report at Codecov.
|
|
I have commented on AWS SAM CLI's PR that was linked to this but the reasons hold true here as well. You can see detailed comments on why the PR was not accepted here. TLDR: |
|
Obsoleted by #3827 ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
No issue number specifically, but this has been mentioned before in several cases and a feature folks have wanted natively in CloudFormation but we aren't going to get anytime soon.
Description of changes:
This simply enhances the yaml parser used to resolve anchors and aliases to a non-referential structure. This lets you do a little bit DRYing up your templates without any external tooling. This should be fully backwards compatible and you only need to use it if you want to.
Important to note, this is doing nothing that nearly all other yaml libs can't do. Take the below template for example and plug it in to http://yaml-online-parser.appspot.com and you'll get perfectly valid json outputs with no additional logic. Of course, you would still need
aws cloudformation packageto populate theCodeUribut that is a different process.Also note, the usage of the Metadata section is inconsequential. It's just an easy place to put stuff without impacting the template. You could just as well anchor to the first instance of properties on your actual resource instance.
Example output from
aws cloudformation packagein this case would be