0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

全リージョンのSQSキューをまとめて消そう

Posted at

PowerShellで実行するコード

foreach ($region in (aws ec2 describe-regions --query "Regions[].RegionName" --output json | ConvertFrom-Json)) {
    echo "region:${region}"
    $queueUrls = (aws sqs list-queues --region $region --query 'QueueUrls' --output json | ConvertFrom-Json)
    foreach ($queueUrl in $queueUrls) {
        echo "delete-queue:$queueUrl"
        aws sqs delete-queue --queue-url $queueUrl --region $region
    }
}

実行結果(test1とtest2を削除した結果)

region:ap-south-1
region:eu-north-1
region:eu-west-3
delete-queue:https://sqs.eu-west-3.amazonaws.com/999999999999/test1
region:eu-west-2
region:eu-west-1
region:ap-northeast-3
region:ap-northeast-2
region:ap-northeast-1
delete-queue:https://sqs.ap-northeast-1.amazonaws.com/999999999999/test2
region:ca-central-1
region:sa-east-1
region:ap-southeast-1
region:ap-southeast-2
region:eu-central-1
region:us-east-1
region:us-east-2
region:us-west-1
region:us-west-2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?