Quantcast
Channel: single keypair for all regions - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by Scott Ford for single keypair for all regions

$
0
0

You can also do this do the region list with expansion to get the list of regions dynamically...

for region in $(aws ec2 describe-regions --all-regions --query "Regions[].{Name:RegionName}" --output text | tr '\n'''); do
aws ec2 import-key-pair --key-name MYKEYNAME --public-key-material file://~/.ssh/MY_PUB_KEY.pub --region $region; done

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>