diff --git a/README.md b/README.md index 7270529..5ccc080 100644 --- a/README.md +++ b/README.md @@ -230,35 +230,13 @@ Type: `string` Default: `""` -### [ami\_name\_filter](#input\_ami\_name\_filter) - -Description: Name filter to help pick the AMI. - -Type: `list(string)` - -Default: - -```json -[ - "vault-consul-ubuntu18-*" -] -``` - ### [ami\_id](#input\_ami\_id) Description: ID of the AMI to be used for the Consul and Vault instances. Type: `string` -Default: `""` - -### [ami\_owner](#input\_ami\_owner) - -Description: AWS account ID of the AMI owner. Defaults to HashiCorp. - -Type: `string` - -Default: `"562637147889"` +Default: `null` diff --git a/data.tf b/data.tf index e0ffb4d..aba8a26 100644 --- a/data.tf +++ b/data.tf @@ -1,21 +1,5 @@ data "aws_region" "current" {} -data "aws_ami" "vault_consul" { - most_recent = true - - owners = [var.ami_owner] - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - filter { - name = "name" - values = var.ami_name_filter - } -} - data "aws_elb" "vault_elb" { name = module.vault_elb.name } diff --git a/main.tf b/main.tf index b457b14..f48559b 100644 --- a/main.tf +++ b/main.tf @@ -5,7 +5,7 @@ module "vault_cluster" { cluster_size = var.vault_cluster_size instance_type = var.vault_instance_type - ami_id = var.ami_id != "" ? var.ami_id : data.aws_ami.vault_consul.image_id + ami_id = var.ami_id user_data = templatefile("${path.module}/user-data/vault.sh.tftpl", { enable_s3_backend = var.enable_s3_backend ? 1 : 0 s3_bucket_region = data.aws_region.current.name @@ -81,7 +81,7 @@ module "consul_cluster" { cluster_size = var.consul_cluster_size instance_type = var.consul_instance_type - ami_id = var.ami_id != "" ? var.ami_id : data.aws_ami.vault_consul.image_id + ami_id = var.ami_id user_data = templatefile("${path.module}/user-data/consul.sh.tftpl", { consul_cluster_tag_key = local.consul_cluster_tag_key consul_cluster_tag_value = local.consul_cluster_tag_val diff --git a/variables.tf b/variables.tf index 25db109..d978adf 100644 --- a/variables.tf +++ b/variables.tf @@ -118,20 +118,8 @@ variable "kms_alias_name" { type = string } -variable "ami_name_filter" { - description = "Name filter to help pick the AMI." - default = ["vault-consul-ubuntu18-*"] - type = list(string) -} - variable "ami_id" { description = "ID of the AMI to be used for the Consul and Vault instances." - type = string - default = "" -} - -variable "ami_owner" { - description = "AWS account ID of the AMI owner. Defaults to HashiCorp." - default = "562637147889" + default = null type = string }