Skip to content
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

list all ARNs in an account - feature proposal #25

Open
mikedlr opened this issue Sep 11, 2019 · 1 comment
Open

list all ARNs in an account - feature proposal #25

mikedlr opened this issue Sep 11, 2019 · 1 comment

Comments

@mikedlr
Copy link

mikedlr commented Sep 11, 2019

I'd like to simply get a list of all resources in my account, giving their ARN. As a JSON query this is non trivial and probably impossible to get right since AWS uses many different ways of giving the ARN (example, sometimes it's just a parameter on the resource ( ARN: "value"), sometimes it's a differently named parameter ( "DBClusterARN") and sometimes

I have a workaround; change into the json directory and run

cat *.json | tr '"' '\n' | grep '^arn:aws' | sort |  sed 's/:\*$//'  | uniq 

I don't see this as fully reliable though, for example if there are references to ARNs in a different account they will turn up which may or may not be a good thing, if there are references to old ARNs that no longer exist, the same.

I think the fix is to have this as an option to aws_list_all. This could start by gathering the values of all parameters which match ^(ARN|[^ ]*Arn) and then printing out the unique values but if AWS changed something might need updated.

@JohannesEbke
Copy link
Owner

There is a similar heuristic trying to determine the ID in https://github.com/JohannesEbke/aws_list_all/blob/master/aws_list_all/query.py#L277 . Pulling that out into a separate function, adding an ARN heuristic and showing both ARN and ID would be great.

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

No branches or pull requests

2 participants