diff --git a/al2.pkr.hcl b/al2.pkr.hcl index a8438e94..0ad2ad5e 100644 --- a/al2.pkr.hcl +++ b/al2.pkr.hcl @@ -142,6 +142,7 @@ build { environment_vars = [ "REGION=${var.region}", "AGENT_VERSION=${var.ecs_agent_version}", + "EBS_CSI_DRIVER_VERSION=${var.ebs_csi_driver_version}", "AIR_GAPPED=${var.air_gapped}", "MANAGED_DAEMON_BASE_URL=${var.managed_daemon_base_url}" ] diff --git a/al2023.pkr.hcl b/al2023.pkr.hcl index 9e482624..78165169 100644 --- a/al2023.pkr.hcl +++ b/al2023.pkr.hcl @@ -110,6 +110,7 @@ build { environment_vars = [ "REGION=${var.region}", "AGENT_VERSION=${var.ecs_agent_version}", + "EBS_CSI_DRIVER_VERSION=${var.ebs_csi_driver_version}", "AIR_GAPPED=${var.air_gapped}", "MANAGED_DAEMON_BASE_URL=${var.managed_daemon_base_url}" ] diff --git a/generate-release-vars.sh b/generate-release-vars.sh index 4073c916..4a8381c7 100755 --- a/generate-release-vars.sh +++ b/generate-release-vars.sh @@ -91,4 +91,5 @@ source_ami_al2023arm = "$ami_name_al2023_arm" kernel_version_al2023 = "$kernel_version_al2023_x86" kernel_version_al2023arm = "$kernel_version_al2023_arm" distribution_release_al2023 = "$distribution_release_al2023" +ebs_csi_driver_version = "$agent_version" EOF diff --git a/scripts/install-managed-daemons.sh b/scripts/install-managed-daemons.sh index d4f77d28..8f7ac42c 100644 --- a/scripts/install-managed-daemons.sh +++ b/scripts/install-managed-daemons.sh @@ -165,7 +165,7 @@ case "$ARCH" in esac # Install CSI driver managed daemon -CSI_DRIVER_FILENAME="ebs-csi-driver${ARCH_MOD}-v$AGENT_VERSION.tar" +CSI_DRIVER_FILENAME="ebs-csi-driver${ARCH_MOD}-v${EBS_CSI_DRIVER_VERSION}.tar" CSI_DRIVER_FULL_URL="${MANAGED_DAEMON_BASE_URL}${CSI_DRIVER_FILENAME}" curl -fLSs -o "$WORK_DIR/${CSI_DRIVER_FILENAME}" "$CSI_DRIVER_FULL_URL" diff --git a/variables.pkr.hcl b/variables.pkr.hcl index 7e7f650e..a20851ad 100644 --- a/variables.pkr.hcl +++ b/variables.pkr.hcl @@ -210,3 +210,8 @@ variable "managed_daemon_base_url" { description = "Base URL (minus file name) to download managed daemons from." default = "" } + +variable "ebs_csi_driver_version" { + type = string + description = "EBS CSI driver version to build AMI with." +} \ No newline at end of file