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..6a56896 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" # HashiCorp Public AMI AWS account +} + 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" {