hashicorp / terraform-google-vault

A Terraform Module for how to run Vault on Google Cloud using Terraform and Packer
Apache License 2.0
113 stars 75 forks source link

Set project variable to allow for multi-project deployments #25

Closed gfenn-newbury closed 5 years ago

gfenn-newbury commented 5 years ago

What this PR does

This MR allows specifying of which project vault-cluster will deploy to, by adding a project variable for each vault instance as ${var.gcp_project_id}, as well as a project variable for the network and firewall rules, ${var.network_project_id}.

Why this PR is needed

The current method uses the project defined in the 'provider' block. This is good for single-project deployments, but when using vault-cluster with other terraform files which need deploying into other projects, there will be no project specified in provider. Each terraform object will have it's project specified instread. This PR will make sure that vault-cluster has the same ability.

josh-padnick commented 5 years ago

LGTM, but again we need to update the main.tf in the root folder to include gcp_project_id. Then ready to merge!

gfenn-newbury commented 5 years ago

That should now be done. Also formatted main.tf with terraform fmt.

gfenn-newbury commented 5 years ago

I've now also formatted the main.tf of vault-cluster

gfenn-newbury commented 5 years ago

Major Change:

Just added a fairly major change - the specifying the project for the network is now different to specifying the project for the compute instances. This allows for deployments which may use a network shared from a different project. Related to: https://github.com/hashicorp/terraform-google-consul/pull/28

josh-padnick commented 5 years ago

Ok, updates made. I'll merge this now but will hold off on issuing a release until we have automated tests that officially validate these changes.