mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 00:13:09 -06:00
DCD-224: Add a helper script and local inventory.
This commit is contained in:
14
bin/scan-latest-amis
Executable file
14
bin/scan-latest-amis
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Quick script to extract the latest version of the target Linux 2 AMI.
|
||||
|
||||
REGIONS="ap-northeast-1 ap-northeast-2 ap-south-1 ap-southeast-1 ap-southeast-2 ca-central-1 eu-central-1 eu-north-1 eu-west-1 eu-west-2 eu-west-3 sa-east-1 us-east-1 us-east-2 us-west-1 us-west-2"
|
||||
|
||||
for REGION in $REGIONS; do
|
||||
ami=`aws --region "${REGION}" ec2 describe-images \
|
||||
--owners amazon \
|
||||
--filters Name=virtualization-type,Values=hvm Name=description,Values="Amazon Linux 2 AMI 2.0.* x86_64 HVM gp2" \
|
||||
--query 'sort_by(Images, &CreationDate)[-1].ImageId' \
|
||||
--output text`
|
||||
echo "${REGION}: $ami"
|
||||
done
|
||||
2
inv/localhost
Normal file
2
inv/localhost
Normal file
@@ -0,0 +1,2 @@
|
||||
[all]
|
||||
localhost ansible_connection=local
|
||||
Reference in New Issue
Block a user