-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: intro "Names.uniqueId()" instead of the deprecated "node.uniqueId" #11166
Conversation
This new version includes the `node.addr` property which deprecates `uniqueId`.
The property `node.uniqueId` is used throughout our codebase to generate unique names. We are planning to deprecate this API in constructs 10.x (and CDK 2.0) in favor of a `node.addr` (see aws/constructs#314). In most cases, these generated names cannot be changed because they will incur breaking changes to deployments. So we have to continue to use the "legacy" unique ID in those cases (new cases should use `addr`). To that end, we introduce a utility `Legacy.uniqueId()` which uses the legacy algorithm and the code base was migrated to use it instead of `node.uniqueId` which will go away soon.
…o benisrae/legacy-uniqueid
afc1780
to
e915f8a
Compare
I don't really like the name Let's categorize where we use
|
Ideally I'd want those generated physical IDs to use I am also okay with being pragmatic here and keeping the current uniqueId algorithm in AWS CDK. I'll revise to: import { Names } from 'core';
Names.uniqueId(c);
Names.nodeUniqueId(c.node); Sounds okay? |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
The property
node.uniqueId
is used throughout our codebase to generate unique names. We are planning to deprecate this API in constructs 10.x (and CDK 2.0) in favor of anode.addr
(see aws/constructs#314).In most cases, these generated names cannot be changed because they will incur breaking changes to deployments. So we have to continue to use the "legacy" unique ID in those cases (new cases should use
addr
).To that end, we introduce a utility
Legacy.uniqueId()
which uses the legacy algorithm and the code base was migrated to use it instead ofnode.uniqueId
which will go away soon.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license