-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from docksal/develop
Release 2.0.0
- Loading branch information
Showing
8 changed files
with
231 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# ubuntu official owner 099720109477 | ||
latest_ami="ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????" | ||
# latest_ami="ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20191002" | ||
|
||
AWS_REGION=$(aws ec2 describe-regions --output text | awk '{print $3}' | xargs) | ||
|
||
echo ' "Region2AMI" : {' | ||
echo " Region2AMI:" | ||
for region in ${AWS_REGION} | ||
do | ||
ami=`aws ec2 describe-images --region ${region} --owners 099720109477 --filters --output json 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId'` | ||
echo ' "'${region}'" : { "AMI" : "'${ami}'" },' | ||
ami=`aws ec2 describe-images --region ${region} --owners 099720109477 --filters --output json 'Name=name,Values='${latest_ami}'' 'Name=state,Values=available' | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId'` | ||
echo " ${region}:" | ||
echo " AMI: ${ami}" | ||
done | ||
echo ' }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.