github.com/tetrafolium/tflint@v0.8.0/tflint/test-fixtures/v0.11.0_module/.terraform/modules/9f93d48a9145c9b1ec2d65897abbd12a/README.md (about) 1 # Consul Security Group Rules Module 2 3 This folder contains a [Terraform](https://www.terraform.io/) module that defines the security group rules used by a 4 [Consul](https://www.consul.io/) cluster to control the traffic that is allowed to go in and out of the cluster. 5 6 Normally, you'd get these rules by default if you're using the [consul-cluster module](https://github.com/hashicorp/terraform-aws-consul/tree/master/MAIN.md), but if 7 you're running Consul on top of a different cluster, then you can use this module to add the necessary security group 8 rules to that cluster. For example, imagine you were using the [nomad-cluster 9 module](https://github.com/hashicorp/terraform-aws-nomad/tree/master/modules/nomad-cluster) to run a cluster of 10 servers that have both Nomad and Consul on each node: 11 12 ```hcl 13 module "nomad_servers" { 14 source = "git::git@github.com:hashicorp/terraform-aws-nomad.git//modules/nomad-cluster?ref=v0.0.1" 15 16 # This AMI has both Nomad and Consul installed 17 ami_id = "ami-1234abcd" 18 } 19 ``` 20 21 The `nomad-cluster` module will provide the security group rules for Nomad, but not for Consul. To ensure those servers 22 have the necessary ports open for using Consul, you can use this module as follows: 23 24 ```hcl 25 module "security_group_rules" { 26 source = "git::git@github.com:hashicorp/terraform-aws-consul.git//modules/consul-security-group-rules?ref=v0.0.2" 27 28 security_group_id = "${module.nomad_servers.security_group_id}" 29 30 # ... (other params omitted) ... 31 } 32 ``` 33 34 Note the following parameters: 35 36 * `source`: Use this parameter to specify the URL of this module. The double slash (`//`) is intentional 37 and required. Terraform uses it to specify subfolders within a Git repo (see [module 38 sources](https://www.terraform.io/docs/modules/sources.html)). The `ref` parameter specifies a specific Git tag in 39 this repo. That way, instead of using the latest version of this module from the `master` branch, which 40 will change every time you run Terraform, you're using a fixed version of the repo. 41 42 * `security_group_id`: Use this parameter to specify the ID of the security group to which the rules in this module 43 should be added. 44 45 You can find the other parameters in [vars.tf](vars.tf). 46 47 Check out the [consul-cluster module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/consul-cluster) for working sample code.