Vermyndax / Amazon Linux AMI Filters Broke Yesterday

Created Tue, 02 Jan 2024 17:29:39 +0000 Modified Tue, 31 Dec 2024 18:25:52 +0000
172 Words

If you’re just coming back to work today to find your data filters in Terraform (or Pulumi, or whatever) are broken while trying to run a deployment, check this out:

https://aws.amazon.com/blogs/aws/update-on-amazon-linux-ami-end-of-life

Amazon has pulled all of the old Amazon Linux AMIs that might respond to your filter. You need to check and make sure your filter is updated. This issue is a little confusing because you can still launch instances from the public SSM parameter, but the API and console won’t let you see it.

Our Terraform filter was the issue:

data "aws_ami" "amazon_linux" {
  most_recent = true
  owners      = ["amazon"]filter {
    name = "name"values = [
      "amzn-ami-hvm-*-x86_64-gp2",
    ]
  }
}

This will need to be changed to something else that will now work. In our case we’re just using this for a bastion, so we felt safe with changing the filter to pull Amazon Linux 2023:

data "aws_ami" "amazon_linux" {
  most_recent = true
  owners      = ["amazon"]filter {
    name = "name"values = [
      "al2023-ami-*-x86_64",
    ]
  }
}

Happy New Year and stuff.