diff --git a/README.md b/README.md index cf6a518..2c32077 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,11 @@ Checkout [examples](./examples) for fully functioning examples. - `create`: [Optional] Create Module, defaults to true. - `name`: [Optional] Name for resources, defaults to "hashistack-aws". +- `ami_owner`: [Optional] Account ID of AMI owner. - `release_version`: [Optional] Release version tag to use (e.g. 0.1.0, 0.1.0-rc1, 0.1.0-beta1, 0.1.0-dev1), defaults to "0.1.0", view releases at https://github.com/hashicorp/guides-configuration#hashistack-version-tables. -- `consul_version`: [Optional] Consul version tag to use (e.g. 1.2.0 or 1.2.0-ent), defaults to "1.2.0". -- `vault_version`: [Optional] Vault version tag to use (e.g. 0.10.3 or 0.10.3-ent), defaults to "0.10.3". -- `nomad_version`: [Optional] Nomad version tag to use (e.g. 0.8.4 or 0.8.4-ent), defaults to "0.8.4". +- `consul_version`: [Optional] Consul version tag to use (e.g. 1.2.3 or 1.2.3-ent), defaults to "1.2.3". +- `vault_version`: [Optional] Vault version tag to use (e.g. 0.11.3 or 0.11.3-ent), defaults to "0.11.3". +- `nomad_version`: [Optional] Nomad version tag to use (e.g. 0.8.6 or 0.8.6-ent), defaults to "0.8.6". - `os`: [Optional] Operating System to use (e.g. RHEL or Ubuntu), defaults to "RHEL". - `os_version`: [Optional] Operating System version to use (e.g. 7.3 for RHEL or 16.04 for Ubuntu), defaults to "7.3". - `vpc_id`: [Required] VPC ID to provision resources in. diff --git a/main.tf b/main.tf index 7abd59a..7f5280c 100644 --- a/main.tf +++ b/main.tf @@ -12,6 +12,7 @@ module "consul_auto_join_instance_role" { data "aws_ami" "hashistack" { count = "${var.create && var.image_id == "" ? 1 : 0}" most_recent = true + owners = ["${var.ami_owner}"] name_regex = "hashistack-image_${lower(var.release_version)}_nomad_${lower(var.nomad_version)}_vault_${lower(var.vault_version)}_consul_${lower(var.consul_version)}_${lower(var.os)}_${var.os_version}.*" filter { diff --git a/variables.tf b/variables.tf index 79f5fc4..d62c109 100644 --- a/variables.tf +++ b/variables.tf @@ -8,24 +8,29 @@ variable "name" { default = "vault-aws" } +variable "ami_owner" { + description = "Account ID of AMI owner." + default = "012230895537" +} + variable "release_version" { description = "Release version tag (e.g. 0.1.0, 0.1.0-rc1, 0.1.0-beta1, 0.1.0-dev1), defaults to \"0.1.0\", view releases at https://github.com/hashicorp/guides-configuration#hashistack-version-tables" default = "0.1.0" } variable "consul_version" { - description = "Consul version tag (e.g. 1.2.0 or 1.2.0-ent), defaults to \"1.2.0\"." - default = "1.2.0" + description = "Consul version tag (e.g. 1.2.3 or 1.2.3-ent), defaults to \"1.2.3\"." + default = "1.2.3" } variable "vault_version" { - description = "Vault version tag (e.g. 0.10.3 or 0.10.3-ent), defaults to \"0.10.3\"." - default = "0.10.3" + description = "Vault version tag (e.g. 0.11.3 or 0.11.3-ent), defaults to \"0.11.3\"." + default = "0.11.3" } variable "nomad_version" { - description = "Nomad version tag (e.g. 0.8.4 or 0.8.4-ent), defaults to \"0.8.4\"." - default = "0.8.4" + description = "Nomad version tag (e.g. 0.8.6 or 0.8.6-ent), defaults to \"0.8.6\"." + default = "0.8.6" } variable "os" {