Add primaryIdentifier to cfnResource trait#2539
Merged
Conversation
...main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java
Show resolved
Hide resolved
JordonPhillips
requested changes
Feb 26, 2025
Contributor
JordonPhillips
left a comment
There was a problem hiding this comment.
Needs updates to the docs
| /// An alternative resource property to use as the primary identifier | ||
| /// for the CloudFormation resource. MUST be the name of a property on | ||
| /// the resource shape that targets a string shape. | ||
| @deprecated(message: "Prefer the resource's identifiers when generating resource schemas") |
Contributor
There was a problem hiding this comment.
Suggested change
| @deprecated(message: "Prefer the resource's identifiers when generating resource schemas") | |
| @deprecated(message: "Prefer the resource's identifiers when generating resource schemas.") |
7e4ff4b to
e71667c
Compare
This commit adds the primaryIdentifier field to the cfnResource trait. This supports service teams that have CFN support that deviates from their APIs in their primary identifier, normally from a human readable value to an ARN. This field is deprecated from the start, as it is not the preferred path for supporting resource identifiers. The value of the primaryIdentifier field, when set, MUST be the name of a property defined on the resource shape and that property MUST be defined as a string or enum shape.
e71667c to
030a170
Compare
JordonPhillips
approved these changes
Feb 26, 2025
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.
This commit adds the
primaryIdentifierfield to the@cfnResourcetrait. This supports service teams that have CFN support that deviates from their APIs in their primary identifier, normally from a human readable value to an ARN. This field is@deprecatedfrom the start, as it is not the preferred path for supporting resource identifiers.The value of the
primaryIdentifierfield, when set, MUST be the name of a property defined on the resource shape and that property MUST be defined as astringorenumshape.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.