Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconinstall-vault
file-type-iconprivate-tls-cert
file-type-iconrun-vault
file-type-iconupdate-certificate-store
file-type-iconvault-cluster
file-type-iconvault-elb
file-type-iconvault-security-group-rules
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconvariables.tf
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf

Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-iconinstall-vault
file-type-iconprivate-tls-cert
file-type-iconrun-vault
file-type-iconupdate-certificate-store
file-type-iconvault-cluster
file-type-iconvault-elb
file-type-iconvault-security-group-rules
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconvariables.tf
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
HashiCorp Vault

HashiCorp Vault

Deploy a Vault cluster. Supports automatic bootstrapping, Consul and S3 backends, self-signed TLS certificates, and auto healing.

Code Preview

Preview the Code

mobile file icon

README.md

down

Vault Security Group Rules Module

This folder contains a Terraform module that defines the security group rules used by a Vault cluster to control the traffic that is allowed to go in and out of the cluster.

Normally, you'd get these rules by default if you're using the vault-cluster module, but if you're running Vault on top of a different cluster, then you can use this module to add the necessary security group rules to that cluster. For example, imagine you were using the consul-cluster module to run a cluster of servers that have both Vault and Consul on each node:

module "cluster" {
  source = "github.com/hashicorp/terraform-aws-consul.git/modules/consul-cluster?ref=v0.0.1"
  
  # This AMI has both Vault and Consul installed
  ami_id = "ami-1234abcd"
}

The consul-cluster module will provide the security group rules for Consul, but not for Vault. To ensure those servers have the necessary ports open for using Vault, you can use this module as follows:

module "security_group_rules" {
  source = github.com/hashicorp/terraform-aws-consul.git/modules/vault-security-group-rules?ref=v0.0.1"

  security_group_id = "${module.cluster.security_group_id}"
  
  # ... (other params omitted) ...
}

Note the following parameters:

  • source: Use this parameter to specify the URL of this module. The double slash (//) is intentional and required. Terraform uses it to specify subfolders within a Git repo (see module sources). The ref parameter specifies a specific Git tag in this repo. That way, instead of using the latest version of this module from the master branch, which will change every time you run Terraform, you're using a fixed version of the repo.

  • security_group_id: Use this parameter to specify the ID of the security group to which the rules in this module should be added.

You can find the other parameters in variables.tf.

Check out the vault-cluster module for example usage.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?