Finding Ubuntu Images with the AWS SSM Parameter Store

Canonical is the publisher of official Ubuntu images on the Amazon cloud. Canonical is now able to publish information about the latest Ubuntu Images into AWS Systems Manager (SSM) parameter store.

These parameters can be used to determine the latest Ubuntu Amazon Machine Images (AMIs), support dates, and more. These parameters can be used directly in run-instances in EC2 and related services like CloudFormation. Additionally, these parameters are available through the GetParametersByPath, GetParameter, and GetParameters API actions for use in scripts and code.

Overview of Available Parameters

Canonical publishes parameters under the /aws/services/canonical space with the following hierarchies:


Parameter: .../ubuntu/PRODUCT/RELEASE/stable/current/ARCH/VIRT_TYPE/VOL_TYPE/ami-id

Where the fields are as follows:

  • PRODUCT: server or server-minimal
  • RELEASE: focal, 20.04, bionic, 18.04, xenial, or 16.04
  • ARCH: amd64 or arm64
  • VIRT_TYPE: pv or hvm
  • VOL_TYPE: ebs-gp2, ebs-io1, ebs-standard, or instance-store

Release Information

Each release has an end of standard maintenance and end of extended security maintenance date. These are obtained as ISO 8601 encoded date (YYYY-MM-DD) from the following paths:

  • .../ubuntu/server/RELEASE/meta/end-of-standard-maintenance-date
  • .../ubuntu/server/RELEASE/meta/end-of-extended-security-maintenance-date

Publisher ID

The official Canonical publisher ID used to publish images can be found from: .../meta/publisher-id


Latest AMI

The latest amd64 bionic AMI ID can be retrieved from the command line with:

aws ssm get-parameters --names \
        /aws/service/canonical/ubuntu/server/18.04/stable/current/amd64/hvm/ebs-gp2/ami-id \
    --query 'Parameters[0].[Value]' --output text

Run an instance with the latest amd64 focal AMI from the command line with:

aws ec2 run-instances \
    --image-id $(aws ssm get-parameters --names \
        /aws/service/canonical/ubuntu/server/focal/stable/current/amd64/hvm/ebs-gp2/ami-id \
    --query 'Parameters[0].[Value]' --output text) \
    --count 1 --instance-type m5.large

To help locating other AMIs from Canonical, use the Publisher ID:

aws ec2 describe-images --owner $(aws ssm get-parameters \
    --names /aws/service/canonical/meta/publisher-id \
    --query 'Parameters[0].[Value]' \
    --output text)

Historical Serial Lookup

If a user has an image serial they wish to confirm the AMI of then instead of using “current” the serial can be used:

aws ssm get-parameters --names \
        /aws/service/canonical/ubuntu/server/20.10/stable/20210222/amd64/hvm/ebs-gp2/ami-id \
    --query 'Parameters[0].[Value]' --output text

This change was introduced on serials dated 20210220 or later.


Users can also reference these parameters in an AWS CloudFormation template:

        Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
        Default: '/aws/service/canonical/ubuntu/server/bionic/stable/current/amd6/hvm/ebs-gp2/ami-id’

        Type: 'AWS::EC2::Instance'
            ImageId: !Ref LatestAmiId

More information about CloudFormation can be found at:
Integrating AWS CloudFormation with AWS Systems Manager Parameter Store


Finally, users can also leverage AWS SSM in terraform templates:

data "aws_ssm_parameter" "ubuntu-focal" {
    name = "/aws/service/canonical/ubuntu/server/20.04/stable/current/amd64/hvm/ebs-gp2/ami-id"

What about if I want to take always the latest LTS?
Do you think that is possible to implement in RELEASE an alias for “lts”?


Will this be available in AWS China? it doesn’t appear to work at the current moment.

Correct, publication to AWS China is a little different than other regions. We hope to have this available for AWS China at a future time.


Is it possible to update SSM parameters for “Osaka” AWS region in public cloud and “us-gov-east-1” and “us-gov-west-1” AWS regions of GOV Cloud?

Application we developed is dependent on this SSM parameter, later are realized that it does return AMI Id for above mentioned regions.

It will be really helpful if this can be fixed as soon as possible.



The recently opened up Osaka region (ap-northeast-3) will get SSM updates soon. We are waiting on our namespace to get added to the region before we can begin publishing updates to it.

As far as GovCloud SSM updates, this is something we would like to do as well, but not something that will get done soon. Besides the access restrictions that come along with GovCloud that complicate automation, we have some namespace work to do there as well.


Hi @pankajc123 ,

the SSM parameters for the latest available images are updated for “Osaka” (ap-northeast-3).
Please let us know if there are any problems.


Thank you so much for this.

Is it possible to update SSM parameter for "us-gov-east-1” and “us-gov-west-1” AWS regions of GOV Cloud also?


This is on our TODO list, but not something we will work on in the near future.