-
-
Save taizo/320e7466de8a1b66b2e1182a71187cb0 to your computer and use it in GitHub Desktop.
AWSで全てのリージョンから無駄リソースを抽出するワンライナー ref: http://qiita.com/saitara/items/a1e3422042a2ec2fb8d7
This file contains 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 characters
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`;do aws ec2 describe-volumes --region ${region} --filters Name=attachment.status,Values=detached;done |
This file contains 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 characters
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`;do aws ec2 describe-addresses --region ${region} --query 'Addresses[?InstanceId==`null`]';done |
This file contains 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 characters
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`;do aws elb describe-load-balancers --query 'LoadBalancerDescriptions[?length(Instances)==`0`].LoadBalancerName' --region ${region};done |
This file contains 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 characters
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`;do aws ec2 describe-network-interfaces --filters Name=attachment.status,Values=detached --region ${region};done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment