FEATURES PRICING ABOUT DOCS LOGIN

consul_keys

consul_keys reads values from the Consul key/value store. This is a powerful way dynamically set values in templates.

Example Usage

data "consul_keys" "app" {
    datacenter = "nyc1"
    token = "abcd"

    # Read the launch AMI from Consul
    key {
        name = "ami"
        path = "service/app/launch_ami"
        default = "ami-1234"
    }
}

# Start our instance with the dynamic ami value
resource "aws_instance" "app" {
    ami = "${data.consul_keys.app.var.ami}"
    ...
}

Argument Reference

The following arguments are supported:

The key block supports the following:

Attributes Reference

The following attributes are exported:


See the source of this document at Terraform.io

REQUEST A DEMO