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

ability to supply vpc_id #9

Merged
merged 2 commits into from
Sep 25, 2017
Merged

ability to supply vpc_id #9

merged 2 commits into from
Sep 25, 2017

Conversation

andrewmeissner
Copy link

Adds the ability to optionally deploy the consul agents to a specified VPC. The default behavior is still maintained, in that if vpc_id is not supplied, the default VPC is used.

@andrewmeissner
Copy link
Author

:( Can someone help give me insight as to why the checks failed?

Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Changes look good overall, just one question below.

The tests are failing because we just moved all our repos over into the hashicorp GitHub account just in time for the Module Registry to be announced and have not had time to hook the automated tests back up with CircleCI.

main.tf Outdated
@@ -151,7 +151,8 @@ data "template_file" "user_data_client" {
# ---------------------------------------------------------------------------------------------------------------------

data "aws_vpc" "default" {
default = true
default = "${var.vpc_id == "" ? true : false}"
id = "${var.vpc_id == "" ? "" : var.vpc_id}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you just set the id param to var.vpc_id without the if-statement? It seems like it would have no effect.

Also, does the aws_vpc data source work correctly if you explicitly set id to an empty string?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brikis98, you're absolutely right about the id param. (facepalm)

I believe the data source does work correctly. I ran terraform both explicitly specifying the vpc_id in the module as well as omitting the parameter. In the former case the instances were associated with the specified vpc, and in the latter, the default vpc was used.

Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@brikis98 brikis98 merged commit eb04a46 into hashicorp:master Sep 25, 2017
@brikis98
Copy link
Collaborator

@andrewmeissner
Copy link
Author

Thanks!

Etiene pushed a commit that referenced this pull request Mar 14, 2019
Get AMIs built in the HashiCorp Blueprints AWS account.
aedades pushed a commit to dreamboxlearning/terraform-aws-consul that referenced this pull request Dec 6, 2022
Add a module for installing and configuring dnsmasq
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants