Skip to content

Commit

Permalink
modify variables.tf to accept AMI attributes via variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcancam authored and Mert Cam committed Oct 15, 2023
1 parent e65050d commit 5411406
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions contrib/terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5411406

Please sign in to comment.