openvidu-deployment: getUbuntuAmiId updated to get non aws-marketplace images

pull/577/head
cruizba 2021-01-11 16:04:25 +01:00
parent dd8dc43653
commit 876fe30230
2 changed files with 7 additions and 8 deletions

View File

@ -17,13 +17,13 @@ TEMPJSON=$(mktemp -t cloudformation-XXX --suffix .json)
# Get Latest Ubuntu AMI id from specified region
# Parameters
# $1 Aws region
getUbuntuAmiId() {
local AMI_ID=$(
aws --region ${1} ec2 describe-images \
--filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64* \
--query 'Images[*].[ImageId,CreationDate]' \
--output text \
| sort -k2 -r | head -n1 | cut -d$'\t' -f1
--filters "Name=name,Values=*ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*" \
--query "sort_by(Images, &CreationDate)" \
| jq -r 'del(.[] | select(.ImageOwnerAlias != null)) | .[-1].ImageId'
)
echo $AMI_ID
}

View File

@ -19,10 +19,9 @@ TEMPJSON=$(mktemp -t cloudformation-XXX --suffix .json)
getUbuntuAmiId() {
local AMI_ID=$(
aws --region ${1} ec2 describe-images \
--filters Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64* \
--query 'Images[*].[ImageId,CreationDate]' \
--output text \
| sort -k2 -r | head -n1 | cut -d$'\t' -f1
--filters "Name=name,Values=*ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*" \
--query "sort_by(Images, &CreationDate)" \
| jq -r 'del(.[] | select(.ImageOwnerAlias != null)) | .[-1].ImageId'
)
echo $AMI_ID
}