FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

consul_prepared_query

Allows Terraform to manage a Consul prepared query.

Managing prepared queries is done using Consul’s REST API. This resource is useful to provide a consistent and declarative way of managing prepared queries in your Consul cluster using Terraform.

Example Usage

resource "consul_prepared_query" "service-near-self" {
    datacenter = "nyc1"
    token = "abcd"
    stored_token = "wxyz"
    name = ""
    only_passing = true
    near = "_agent"

    template {
        type = "name_prefix_match"
        regexp = "^(.*)-near-self$"
    }

    service = "$${match(1)}"

    failover {
        nearest_n = 3
        datacenters = ["dc2", "dc3", "dc4"]
    }

    dns {
        ttl = "5m"
    }

}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:


See the source of this document at Terraform.io