-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(aws-ssm): correctly emit Association.Name #854
Conversation
The rename used to happen in the cfnspec, which helped the model generate correct names, but the code generator would lose the ability to access the original name, and so it could not be emitted correctly. Add a property renaming feature to the 'cfn2ts' code generator (configured via a special entry in package.json). Fixes #852.
Not sure I like this and it makes me wonder: maybe we should just get rid of the "name" => "xxxName" renames altogether in L1. The reason we are actually doing these renames was that the construct ID used to be a "name" prop, so if an L1 had a However, now construct IDs are not a prop, and we technically don't need these renames at all. |
} | ||
if (finalNames.has(propName)) { | ||
throw new Error(`Oh gosh, there was already a property named ${propName}!`); |
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.
Thanks for preserving the spirit
True, that was the original reason. At the same time, I do like the transformation we're doing right now, if only to make the object model more consistent. The CloudFormation object model isn't always consistent in the names it uses, but I'd rather have our model be consistent. For example (in no particular order, just random sampling from the CloudFormation model):
And at the same time, when we generate I'm aware we could be providing this uniformity at the L2 level as well... but this is just such a convenient place to add it. I'm torn. |
I think there is value in staying 1:1 with the CFN resource spec at L1. It makes it easier for people to navigate this layer, find help and in general have less magic. I vote for removing this sugar... |
Regarding the |
@RomainMuller This is about the resource properties ( |
Oh, duh. 🤦🏻♂️ |
@rix0rrr do you want me to pick this up? |
The rename used to happen in the cfnspec, which helped the model
generate correct names, but the code generator would lose the ability to
access the original name, and so it could not be emitted correctly.
Add a property renaming feature to the 'cfn2ts' code generator
(configured via a special entry in package.json).
Fixes #852.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.