--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: cloud.debian.org: Provide AMI image ID that is always recent
- From: tkoeck <tkoeck@imap.a2gb.de>
- Date: Thu, 01 Oct 2020 17:16:36 +0200
- Message-id: <160156539633.17152.5998079940788372642.reportbug@tron-nb.qudosoft.de>
Package: cloud.debian.org
Severity: wishlist
Dear Maintainer,
is there an AMI image ID that is always the recent one?
As far as I have seen the AMI image ID always changes for every
subversion (e.g. Debian 10.0 to 10.1)?
It would be interesting to have an AMI image ID which would always
represent the newest Debian 10 AMI image with all security updates
installed.
Greetings
Tobias
-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.8.0-2-amd64 (SMP w/16 CPU threads)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
--- End Message ---
--- Begin Message ---
- To: tkoeck <tkoeck@imap.a2gb.de>, 971545-done@bugs.debian.org
- Subject: Re: Bug#971545: cloud.debian.org: Provide AMI image ID that is always recent
- From: Noah Meyerhans <noahm@debian.org>
- Date: Tue, 31 Aug 2021 14:55:26 -0700
- Message-id: <YS6lTndOsOv624F4@doom.morgul.net>
- In-reply-to: <160156539633.17152.5998079940788372642.reportbug@tron-nb.qudosoft.de>
- References: <160156539633.17152.5998079940788372642.reportbug@tron-nb.qudosoft.de>
On Thu, Oct 01, 2020 at 05:16:36PM +0200, tkoeck wrote:
> is there an AMI image ID that is always the recent one?
>
> As far as I have seen the AMI image ID always changes for every
> subversion (e.g. Debian 10.0 to 10.1)?
>
> It would be interesting to have an AMI image ID which would always
> represent the newest Debian 10 AMI image with all security updates
> installed.
As others have pointed out, the EC2 APIs already provide this
functionality, so I don't think there's anything we need to do.
To summarize the different mechanisms (and, because this is how things
work, provide my own):
1. Use the AWS Marketplace AMIs:
https://aws.amazon.com/marketplace/seller-profile?id=4d4d4e5f-c474-49f2-8b18-94de9d43e2c0&ref=dtl_B0859NK4HC
2. Find the AMIs from the wiki:
https://wiki.debian.org/Cloud/AmazonEC2Image/
3. Query the EC2 APIs directly. Others have provided some examples of
how to do this. I like the following, adjusted for release, backports,
region, etc, as appropriate:
aws ec2 --region us-west-2 --output json describe-images \
--owner 136693071363 \
--filters "Name=architecture,Values=x86_64" "Name=name,Values=debian-11*" \
--query "Images[?contains(Name, 'backports') == \`false\`] | max_by([], &CreationDate)"
--- End Message ---