-
Notifications
You must be signed in to change notification settings - Fork 391
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
chore(addons): merge cfn templates Mappings section #1009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,8 @@ | |||
Mappings: | |||
MyTableDynamoDBSettings: | |||
test: # The order is different inside "test" so it should error out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why should the order matter? just in the way yaml is marshaled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I see. It's the way that nodes are marshaled into an array above (how you have to do this dance of checking the ith index, then the i+1th index for the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we can be smarter in the isEqual
fn and not have the order matter if the node is a "!!map" but I kept it dumb for a first iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever! looks good to me.
ed: What happens if there is more than two levels of mapping? forbidden by CF? Or recursive?
Not possible AFAIK https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html
|
Enables merging the Mappings section of cfn templates under the "addons/" directory.
Related #994
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.