From 89dbfb9b7b1ec3f1e769d27daff7221868537a3a Mon Sep 17 00:00:00 2001 From: lilyeyes Date: Wed, 23 Aug 2023 18:55:19 +0800 Subject: [PATCH] Deploy valid AWS images past their DeprecationTime TEAM-8177 - [AWS][Terraform] qe-sap-deployment cannot deploy valid images past their DeprecationTime --- terraform/aws/modules/get_os_image/main.tf | 10 ++++++++-- terraform/aws/version.tf | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/terraform/aws/modules/get_os_image/main.tf b/terraform/aws/modules/get_os_image/main.tf index 5f5637b3..b33d1a5a 100644 --- a/terraform/aws/modules/get_os_image/main.tf +++ b/terraform/aws/modules/get_os_image/main.tf @@ -1,7 +1,8 @@ # Data used to get the correct AMI image data "aws_ami" "image" { - most_recent = true - owners = [var.os_owner] + most_recent = true + owners = [var.os_owner] + include_deprecated = true filter { name = "name" @@ -22,4 +23,9 @@ data "aws_ami" "image" { name = "virtualization-type" values = ["hvm"] } + + filter { + name = "state" + values = ["available"] + } } diff --git a/terraform/aws/version.tf b/terraform/aws/version.tf index 6be93e84..de45616f 100644 --- a/terraform/aws/version.tf +++ b/terraform/aws/version.tf @@ -4,11 +4,11 @@ terraform { # Configure the Azure Provider aws = { source = "hashicorp/aws" - version = "~> 4.0.0" + version = "~> 5.14.0" } null = { source = "hashicorp/null" - version = "~> 3.1.0" + version = "~> 3.2.1" } } }