Skip to content

Instantly share code, notes, and snippets.

@copolycube
Created June 17, 2019 18:55
Show Gist options
  • Save copolycube/0cb4c819e399fbcb545b092502b7d734 to your computer and use it in GitHub Desktop.
Save copolycube/0cb4c819e399fbcb545b092502b7d734 to your computer and use it in GitHub Desktop.
Execute code over all AWS regions
#!/bin/bash
## oneline : for r in $(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text --region ca-central-1); do echo "---------- AWS Region : $r ----------" ; echo "hello world"; done
for r in $(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text --region ca-central-1);
do
echo "---------- AWS Region : $r ----------" ;
echo "hello world";
done
@copolycube
Copy link
Author

Notes :
the --region ca-central-1 is not necessary if you defined a default region in your AWS cli configuration; adding it makes it generic.

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