openvidu-deployment: delete_amis.sh: Different region for each iteration
This commit is contained in:
parent
ca14a626e6
commit
5e652c19a4
@ -2,12 +2,12 @@
|
||||
set -eu -o pipefail
|
||||
|
||||
# Remove the list of AMIs in each region
|
||||
export AWS_DEFAULT_REGION=${REGION}
|
||||
|
||||
for line in ${AMI_LIST}
|
||||
do
|
||||
REGION=$(echo "${line}" | cut -d":" -f1)
|
||||
AMI_ID=$(echo "${line}" | cut -d":" -f2)
|
||||
export AWS_DEFAULT_REGION=${REGION}
|
||||
|
||||
mapfile -t SNAPSHOTS < <(aws ec2 describe-images --image-ids "$AMI_ID" --output text --query 'Images[*].BlockDeviceMappings[*].Ebs.SnapshotId')
|
||||
echo "Deregistering $AMI_ID"
|
||||
aws ec2 deregister-image --image-id "${AMI_ID}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user