Last active
August 3, 2022 09:56
-
-
Save xbalaji/2722b4ee9a7a88bfd0fdd5feeb8cf22a to your computer and use it in GitHub Desktop.
Revisions
-
xbalaji renamed this gist
Feb 24, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
xbalaji revised this gist
Sep 25, 2019 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,10 @@ aws ec2 describe-regions --output text | cut -f3- # the use resourcegrouptaggingapi to list resources in each region aws resourcegroupstaggingapi get-resources --region ${REG_NAME} | jq -r '.[][] | .ResourceARN' aws resourcegroupstaggingapi get-resources --tag-filters "Key=XYZ" | jq -r '.[][] | .ResourceARN as $res | .Tags[] | select(.Key == "XYZ") | [$res, .Value ] | @csv ' # display all non-us regions aws ec2 describe-regions | jq -r '.Regions[] | select(.RegionName | test("^(?!(us-).*)")) | .RegionName' # display all resources in non-us regions aws ec2 describe-regions | jq -r '.Regions[] | select(.RegionName | test("^(?!(us-).*)")) | .RegionName' | xargs -t -L 1 -I {} aws resourcegroupstaggingapi get-resources --region {} | jq -r '.ResourceTagMappingList[].ResourceARN' -
xbalaji renamed this gist
Sep 22, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
xbalaji created this gist
Sep 5, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ # list all regions aws ec2 describe-regions --output text | cut -f3- # the use resourcegrouptaggingapi to list resources in each region aws resourcegroupstaggingapi get-resources --region ${REG_NAME} | jq -r '.[][] | .ResourceARN' aws resourcegroupstaggingapi get-resources --tag-filters "Key=XYZ" | jq -r '.[][] | .ResourceARN as $res | .Tags[] | select(.Key == "XYZ") | [$res, .Value ] | @csv '