Skip to content

Commit ea234b5

Browse files
author
Gabriel Monroy
committed
add script to distribute AMIs across regions #21
1 parent ed9e3a9 commit ea234b5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

contrib/distribute-amis.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Distribute AMIs across regions using EC2 CLI tools
4+
#
5+
6+
if [ -z $2 ] ; then
7+
echo usage: $0 [src-region] [src-ami]
8+
exit 1
9+
fi
10+
11+
set -ex
12+
13+
src_region=$1
14+
src_ami=$2
15+
16+
# copy the ami to every other region
17+
for region in ap-northeast-1 ap-southeast-1 ap-southeast-2 eu-west-1 sa-east-1 us-east-1 us-west-1 us-west-2; do
18+
[ $region = $src_region ] && continue
19+
ec2-copy-image -r $src_region -s $src_ami --region $region
20+
done

0 commit comments

Comments
 (0)