-
Notifications
You must be signed in to change notification settings - Fork 910
ARN Parser #960
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
Comments
In tigertoes/aws-sdk-java-v2@18f791e I've made a first past go at including this functionality - early feedback on this would be greatly appreciated. I'll be looking to add more tests and address the TODOs that should be removed prior to raising a pull request alongside with any other comments given to me. |
@zoewangg @TigerToes please, apply this fix to main branch |
@TigerToes, I really like that you have done this. The only feedback that I have is that the "getter" methods do not follow the fairly ubiquitous Java naming conventions for getters, such as "getPartition", "getService", "getRegion", etc., so as a long-time Java developer I was a little confused when trying to pull up the methods with code completion. I recommend naming them to follow the common "Java-isms". The same with the Builder--naming that many Java developers will be familiar with would be "withPartition", "withService", etc. This is nitpicking but might make it a bit easier to use. |
@nathanagood thank you for the feedback, I've incorporated those changes into tigertoes/aws-sdk-java-v2@eaf7d1a. |
This is implemented in #1462. You can parse an arn string via |
The feature has been released as part of |
I am prepared to invest in the necessary development effort to at least make a first public version of this available.
Expected Behavior
A class able to parse the useful pieces of information and delineate them within an ARN string. This does not need to happen automatically to begin with (i.e. where ARNs are represented in API responses, these need not for today have to be converted from the String type they typically are). It would also make sense that the Object also carries a
.toString()
method that returns the ARN as it's usually transmitted.Current Behavior
Presently the Java SDK provides no means of supporting this as ARNs are typically reprsented as String types within fields.
There is however several examples of prior art: The Go SDK provides the ability to do so, in addition to a 3rd part library in Java.
Possible Solution
I propose including a new parser inside of the util package space, as well as a new object to represent all the common fields. Additional classes may be created in their respective service namespaces and extended as needed however I feel that may be outside of scope for the initial work.
Steps to Reproduce (for bugs)
N/A as this is a feature request.
Context
Within my organisation I have noticed several different implementations of trying to perform this task (e.g. wanting to extract the account ID from an ARN, or other such values). This reinvention and use of splitting on colon has lead to poor code showing up in our code base and I believe as there is usage elsewhere there would be a benefit to all having it present within the core SDK.
Your Environment
N/A as this is a feature request.
The text was updated successfully, but these errors were encountered: