Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

enable volume parsing #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schosterbarak
Copy link

fix issue:
#8

and enable volume arn parsing

@@ -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:]
Copy link
Contributor

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?

Copy link
Author

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?

Copy link
Contributor

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.

Copy link
Author

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?

Copy link
Contributor

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.

Copy link
Contributor

@laurrentt laurrentt Oct 21, 2019

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.

2019-10-21 at 1 49 PM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants