From 32b61285728a0423770637fbad1cd77e32cfed22 Mon Sep 17 00:00:00 2001 From: Jon Benson Date: Sat, 13 Oct 2018 13:50:59 -0700 Subject: [PATCH 1/2] Update version --- README.md | 3 ++- main.tf | 1 + variables.tf | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1bccc72..2544f37 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,9 @@ Checkout [examples](./examples) for fully functioning examples. - `create`: [Optional] Create Module, defaults to true. - `name`: [Optional] Name for resources, defaults to "consul-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". +- `consul_version`: [Optional] Consul version tag to use (e.g. 1.2.3 or 1.2.3-ent), defaults to "1.2.3". - `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 37e38fa..a046f23 100644 --- a/main.tf +++ b/main.tf @@ -12,6 +12,7 @@ module "consul_auto_join_instance_role" { data "aws_ami" "consul" { count = "${var.create && var.image_id == "" ? 1 : 0}" most_recent = true + owners = ["${var.ami_owner}"] name_regex = "consul-image_${lower(var.release_version)}_consul_${lower(var.consul_version)}_${lower(var.os)}_${var.os_version}.*" filter { diff --git a/variables.tf b/variables.tf index 17e2880..cefbd9e 100644 --- a/variables.tf +++ b/variables.tf @@ -8,14 +8,19 @@ variable "name" { default = "consul-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 "os" { From 0bdc7e7edb0c2ba33aa5bd7aae17a590bbbff195 Mon Sep 17 00:00:00 2001 From: Jon Benson Date: Sat, 13 Oct 2018 14:20:20 -0700 Subject: [PATCH 2/2] Document AMI owner --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index cefbd9e..6a56896 100644 --- a/variables.tf +++ b/variables.tf @@ -10,7 +10,7 @@ variable "name" { variable "ami_owner" { description = "Account ID of AMI owner." - default = "012230895537" + default = "012230895537" # HashiCorp Public AMI AWS account } variable "release_version" {