diff --git a/terraform/aws/modules/get_os_image/main.tf b/terraform/aws/modules/get_os_image/main.tf index 5f5637b3..efa00e2c 100644 --- a/terraform/aws/modules/get_os_image/main.tf +++ b/terraform/aws/modules/get_os_image/main.tf @@ -1,11 +1,12 @@ # 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" - values = substr(var.os_image, 0, 4) == "ami-" ? ["*"] : ["${var.os_image}-*"] + values = substr(var.os_image, 0, 4) == "ami-" ? ["*"] : ["${var.os_image}*"] } filter { @@ -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..3266e72b 100644 --- a/terraform/aws/version.tf +++ b/terraform/aws/version.tf @@ -4,7 +4,7 @@ terraform { # Configure the Azure Provider aws = { source = "hashicorp/aws" - version = "~> 4.0.0" + version = "~> 5.13.1" } null = { source = "hashicorp/null" diff --git a/terraform/gcp/variables.tf b/terraform/gcp/variables.tf index 1059dd2d..071a37a2 100644 --- a/terraform/gcp/variables.tf +++ b/terraform/gcp/variables.tf @@ -81,7 +81,7 @@ variable "deployment_name" { default = "" validation { condition = ( - var.deployment_name != "default" && var.deployment_name != "" + var.deployment_name != "default" ) error_message = "Invalid deployment_name (default) ." }