From 541140681a04243b44ec80662cb3d2b5a36cfb84 Mon Sep 17 00:00:00 2001 From: Mertcan CAM Date: Fri, 13 Oct 2023 16:02:45 +0300 Subject: [PATCH] modify variables.tf to accept AMI attributes via variables --- contrib/terraform/aws/variables.tf | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/contrib/terraform/aws/variables.tf b/contrib/terraform/aws/variables.tf index 479629e2f30..783d4adffbb 100644 --- a/contrib/terraform/aws/variables.tf +++ b/contrib/terraform/aws/variables.tf @@ -20,20 +20,38 @@ variable "aws_cluster_name" { description = "Name of AWS Cluster" } +variable "ami_name_pattern" { + description = "The name pattern to use for AMI lookup" + type = string + default = "debian-10-amd64-*" +} + +variable "ami_virtualization_type" { + description = "The virtualization type to use for AMI lookup" + type = string + default = "hvm" +} + +variable "ami_owners" { + description = "The owners to use for AMI lookup" + type = list(string) + default = ["136693071363"] +} + data "aws_ami" "distro" { most_recent = true filter { name = "name" - values = ["debian-10-amd64-*"] + values = [var.ami_name_pattern] } filter { name = "virtualization-type" - values = ["hvm"] + values = [var.ami_virtualization_type] } - owners = ["136693071363"] # Debian-10 + owners = var.ami_owners } //AWS VPC Variables