Skip to content

Commit

Permalink
Deploy valid AWS images past their DeprecationTime
Browse files Browse the repository at this point in the history
TEAM-8177 - [AWS][Terraform] qe-sap-deployment cannot deploy valid images past their DeprecationTime
  • Loading branch information
lilyeyes committed Aug 25, 2023
1 parent 7b337b8 commit 3e35b98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions terraform/aws/modules/get_os_image/main.tf
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -22,4 +23,9 @@ data "aws_ami" "image" {
name = "virtualization-type"
values = ["hvm"]
}

filter {
name = "state"
values = ["available"]
}
}
2 changes: 1 addition & 1 deletion terraform/aws/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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) ."
}
Expand Down

0 comments on commit 3e35b98

Please sign in to comment.