Skip to content

[Bug] Finding latest Ubuntu AMI ID returns null #62

@ravinperera00

Description

@ravinperera00

We try to obtain the latest Ubuntu AMI ID here.

latest_ami_id="$(aws ec2 describe-images --owners 099720109477 --filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????' 'Name=state,Values=available' --output json | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId')"

But this returns null (probably because the Ubuntu version we are looking for is deprecated).

We could either update the Ubuntu version (if it is safe to do so), or add the additional option --include-deprecated to fetch the AMI IDs of old Ubuntu versions.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions