[core] Prefix mutable L1 properties with prop
#11667
Labels
@aws-cdk/core
Related to core CDK functionality
cause/l1-name-instead-of-ref
Caused by users using CfnSomething.somethingName instead of CfnSomething.ref
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
package/cfn
Related to the CFN layer (L1)
wontfix
We have determined that we will not resolve the issue.
It's quite common for people to be using L1s, and then try to refer to the name of the recently-generated resource by using the name property.
For example:
This looks seductive and sane, but is actually wrong.
dashboardName
is a mutable version of the (input) property, and typicallyundefined
, NOT a reference generated/calculated name of the resource ({ Ref }
), which also implies a dependency.The correct usage would have been:
Depending on the use case.
People get this wrong all the time, because it's a CFN quirk that we expect people to be familiar with, but they're not.
Bug reports caused by this design mistake:
https://github.com/aws/aws-cdk/issues?q=is%3Aissue+label%3Acause%2Fl1-name-instead-of-ref+is%3Aclosed
A good solution would probably be to deprecate the old property names and properly prefix them with
prop
(propDashboardName
).Hopefully that will give people a fighting chance figuring out what they're looking for.
Probably needs to be prioritized for v2 because after V2 the deprecation (but availability) of the old property names means people will continue making the same mistakes.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: