lib/kitchen/driver/aws/standard_platform/debian.rb in kitchen-ec2-3.10.1 vs lib/kitchen/driver/aws/standard_platform/debian.rb in kitchen-ec2-3.11.0
- old
+ new
@@ -21,20 +21,21 @@
class StandardPlatform
# https://wiki.debian.org/Cloud/AmazonEC2Image
class Debian < StandardPlatform
StandardPlatform.platforms["debian"] = self
- # 11/12 are listed last since we default to the first item in the hash
- # and 11/12 are not released yet. When they're released move them up
+ # 12/13 are listed last since we default to the first item in the hash
+ # and 12/13 are not released yet. When they're released move them up
DEBIAN_CODENAMES = {
+ 11 => "bullseye",
10 => "buster",
9 => "stretch",
8 => "jessie",
7 => "wheezy",
6 => "squeeze",
- 11 => "bullseye",
12 => "bookworm",
+ 13 => "trixie",
}.freeze
# default username for this platform's ami
# @return [String]
def username
@@ -49,14 +50,26 @@
end
v ? DEBIAN_CODENAMES[v.to_i] : DEBIAN_CODENAMES.values.first
end
def image_search
- search = {
- "owner-id" => "379101102735",
- "name" => "debian-#{codename}-*",
- }
+ search = {}
+
+ # The Debian AWS owner ID changed for releases 10 and onwards
+ # See https://wiki.debian.org/Amazon/EC2/HowTo/awscli
+ if version.nil?
+ search["owner-id"] = "136693071363"
+ search["name"] = "debian-#{DEBIAN_CODENAMES.keys.first}-*"
+ elsif version.to_i >= 10
+ search["owner-id"] = "136693071363"
+ search["name"] = "debian-#{version.to_i}-*"
+ else
+ search["owner-id"] = "379101102735"
+ search["name"] = "debian-#{codename}-*"
+ end
+
search["architecture"] = architecture if architecture
+
search
end
def self.from_image(driver, image)
if /debian/i.match?(image.name)