-
Notifications
You must be signed in to change notification settings - Fork 7
enable volume parsing #9
base: master
Are you sure you want to change the base?
Conversation
@@ -26,6 +26,10 @@ def arnparse(arn_str): | |||
raise MalformedArnError(arn_str) | |||
|
|||
elements = arn_str.split(':', 5) | |||
|
|||
if "volume/vol-" in arn_str: | |||
elements = elements[:2] + ["volume"] + elements[2:] |
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.
If you take a look at the actual list of AWS services. volume
is not one of them. I think we should either specify ec2
as the service (which is more accurate), or we could leave it empty to represent the fact that it's not part of the ARN. What do you think?
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.
ec2 might be miss-leading. though it is the service, it can often be referred as a VM.
ec2 contains multiple services in aws.
Maybe the best name would be EBS?
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.
I forgot to paste the link to the service page: https://docs.aws.amazon.com/general/latest/gr/rande.html. You can see that neither volume
nor ebs
is an actual AWS service. Per experience, AWS almost never reference anything by the term VM, so I wouldn't go with that.
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.
got it. thanks.
How would you suggest supporting volume arn parsing without loosing the ability to categorize the type?
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.
If you take a look at the CloudFormation definition of a Volume. It's categorized as being part of EC2. But I'm really curious as to where did you get this ARN from? I think I never saw a volume ARN before. I honestly thought they didn't exist.
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.
According to this page https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-policy-structure.html#EC2_ARN_Format, the volume ARN does, in fact, include the ec2
service name: arn:aws:ec2:region:account:volume/volume-id
.
fix issue:
#8
and enable volume arn parsing