Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Support tagged lookups on VPC & Subnets #38

Closed
jasonmcintosh opened this issue Feb 5, 2018 · 6 comments
Closed

Support tagged lookups on VPC & Subnets #38

jasonmcintosh opened this issue Feb 5, 2018 · 6 comments

Comments

@jasonmcintosh
Copy link
Contributor

For systems NOT using the default vpc (e.g. using the terraform vpc module), there are often public and private subnets created. This means 6 subnets 2 per AZ, which breaks this module. One thought is to add a variable

variable "subnet_tags" {
##   Tier = "Private"

}

and modify main.tf to do

data "aws_subnet_ids" "default" {
  vpc_id = "${data.aws_vpc.default.id}"
  tags = "${var.subnet_tags}"
}

Then apply similar logic to the aws_vpc block

@brikis98
Copy link
Collaborator

brikis98 commented Feb 5, 2018

Assuming that Terraform treats an empty tags value the same as no value at all, I'm definitely in favor of this change!

@jasonmcintosh
Copy link
Contributor Author

:) NULL != 0 != "" != [] != {} :)

@brikis98
Copy link
Collaborator

brikis98 commented Feb 5, 2018

Haha, yep. I even filed a bug about it: hashicorp/terraform#14037

@jasonmcintosh
Copy link
Contributor Author

#39 :)

@patoarvizu
Copy link
Contributor

patoarvizu commented Feb 13, 2018

#39 Adds support for tagged lookups on the main "example", but not on the vault-cluster module, which is where I think would be more valuable, since the main example is not one-size-fits-all. Plus I don't think examples are supposed to be considered production-ready anyway (or at least they should be considered less production-ready than modules). I'll open an issue for it.

EDIT: I meant open a PR, as soon as I have one :)

@jasonmcintosh
Copy link
Contributor Author

@patoarvizu vpc_id in the vault-cluster module is just a variable. It's up to the client depending on it as a module to set it. Either through a data lookup or similar. The main is an example implementation of how to do so. In theory, you could pass a set of filters or tags instead of the vpc_id but that starts to complicate the module. This way you can do any of the available options.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants