From c1cb5fdbcae0175d3366791d587cdf9ff96d6b28 Mon Sep 17 00:00:00 2001 From: Jaideep <79799016+jayfranco999@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:25:12 +0530 Subject: [PATCH] chore(ubuntu): Use pinned aws base AMI IDs from `images-versions.yaml` (#1472) * feat(ubuntu):Pin ubuntu 22.04 AMI ids Signed-off-by: jayfranco999 * fixup Signed-off-by: jayfranco999 --------- Signed-off-by: jayfranco999 --- build-jenkins-agent-ubuntu.pkr.hcl | 2 +- locals.pkr.hcl | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/build-jenkins-agent-ubuntu.pkr.hcl b/build-jenkins-agent-ubuntu.pkr.hcl index 173b8bca4..3ed72fde5 100644 --- a/build-jenkins-agent-ubuntu.pkr.hcl +++ b/build-jenkins-agent-ubuntu.pkr.hcl @@ -7,7 +7,7 @@ build { name = "ubuntu" ssh_username = "ubuntu" # Egg-and-chicken: what is the base image to start from (eg. what is my egg)? - source_ami = local.aws_ubuntu_amis[var.architecture] + source_ami = try(local.images_versions["aws"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") } source "azure-arm.base" { diff --git a/locals.pkr.hcl b/locals.pkr.hcl index e0f6d1a78..9e2a8d11f 100644 --- a/locals.pkr.hcl +++ b/locals.pkr.hcl @@ -11,11 +11,6 @@ locals { "arm64" = "t4g.xlarge" } # TODO: track AMI versions with `updatecli` - # Uses aws ec2 describe-images to fetch the ami id as per the architecture - aws_ubuntu_amis = { - "amd64" = "ami-00eb69d236edcfaf8" - "arm64" = "ami-039e419d24a37cb82" - } # List available SKUs with the command `az vm image list-skus --offer 0001-com-ubuntu-server-jammy --location eastus --publisher canonical --output table` az_instance_image_sku = { "amd64" = "${local.agent_os_version_safe}-lts-gen2"