You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 16, 2023. It is now read-only.
With cloudformation I can recover a list of resources created by each stack but the data about each resource does not include the ARN.
In order to be able to match resources to cloudformation stacks I would like to be able to be able to use arnparse to generate ARNs from the constituent data recovered from a cloudformation stack. See also the output ofaws cloudformation list-stack-resources
I'd propose implementing a __str__ method which returns the ARN and a __repr__ method which returns an ARN instantiation call.
In fact I'm probably going to go ahead and do this, but I'd like to put up an issue to explain it first.
The text was updated successfully, but these errors were encountered:
Hey @mikedlr, that sounds cool. However, for it to work it would require the code to gather your account id, current region and somehow find the service the resource belongs to. It would have to know all the corner cases regarding ARNs, like the fact that S3 buckets don't specify the region, etc. Would you input all those properties? or would you expect arnparse to make the appropriate boto3 calls to gather this information?
I think I'd normally provide the missing parameters since it's impossible to be sure what parameters were actually used during a call that created the JSON but I would provide a function like guess_aws_params which would use normal AWS credential resolution (arguments / environment / default credentials in .aws from environemnt / default in .aws) to fill in the rest on demand. Maybe a guess=true parmeter when creating the ARN object?
In my use case I would get an ARN for a cloudformation stack and then parse it and then call the cloudformation API call, so I would already know (from the original ARN) all the parameters I need. Also I will be scanning over all regions so I couldn't rely on the guess function.
@laurrentt further on the comment on the need to understand the structure of ARNs - that's precisely the reason I went looking for a library. My most important need is to be able to match against other ARNs so I'll need a consistent way of understanding and generating them correctly.
I was skeptical at first, mainly because I didn't get that the actual gathering of information would be left outside arnparse. But I like the idea and I think it's compatible with the goal of this library.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
With cloudformation I can recover a list of resources created by each stack but the data about each resource does not include the ARN.
In order to be able to match resources to cloudformation stacks I would like to be able to be able to use arnparse to generate ARNs from the constituent data recovered from a cloudformation stack. See also the output of
aws cloudformation list-stack-resources
I'd propose implementing a
__str__
method which returns the ARN and a__repr__
method which returns an ARN instantiation call.In fact I'm probably going to go ahead and do this, but I'd like to put up an issue to explain it first.
The text was updated successfully, but these errors were encountered: