github.com/tetrafolium/tflint@v0.8.0/tflint/test-fixtures/v0.11.0_module/.terraform/modules/002be730f1b024817d11366b76178a82/README.md (about)

     1  # Consul IAM Policies
     2  
     3  This folder contains a [Terraform](https://www.terraform.io/) module that defines the IAM Policies used by a 
     4  [Consul](https://www.consul.io/) cluster. 
     5  
     6  Normally, you'd get these policies by default if you're using the [consul-cluster submodule](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/consul-cluster), 
     7  but if you're running Consul on top of a different cluster (e.g. you're co-locating Consul with Nomad), then you can 
     8  use this module to add the necessary IAM policies to that that cluster. For example, imagine you were using the 
     9  [nomad-cluster module](https://github.com/hashicorp/terraform-aws-nomad/tree/master/modules/nomad-cluster) to run a 
    10  cluster of 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 IAM policies for Nomad, but not for Consul. To ensure those servers
    22  have the necessary IAM permissions to run Consul, you can use this module as follows:
    23  
    24  ```hcl
    25  module "iam_policies" {
    26    source = "git::git@github.com:hashicorp/terraform-aws-consul.git//modules/consul-iam-policies?ref=v0.0.2"
    27  
    28    iam_role_id = "${module.nomad_servers.iam_role_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  * `iam_role_id`: Use this parameter to specify the ID of the IAM Role 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 example](https://github.com/hashicorp/terraform-aws-consul/tree/master/MAIN.md) for working sample code.