1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. PreparedQuery
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

consul.PreparedQuery

Explore with Pulumi AI

consul logo
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    
    // Creates a prepared query myquery.query.consul that finds the nearest
    // healthy myapp.service.consul instance that has the active tag and not
    // the standby tag.
    const myapp_query = new consul.PreparedQuery("myapp-query", {
        name: "myquery",
        datacenter: "us-central1",
        token: "abcd",
        storedToken: "wxyz",
        onlyPassing: true,
        near: "_agent",
        service: "myapp",
        tags: [
            "active",
            "!standby",
        ],
        failover: {
            nearestN: 3,
            datacenters: [
                "us-west1",
                "us-east-2",
                "asia-east1",
            ],
        },
        dns: {
            ttl: "30s",
        },
    });
    // Creates a Prepared Query Template that matches *-near-self.query.consul
    // and finds the nearest service that matches the glob character (e.g.
    // foo-near-self.query.consul will find the nearest healthy foo.service.consul).
    const service_near_self = new consul.PreparedQuery("service-near-self", {
        datacenter: "nyc1",
        token: "abcd",
        storedToken: "wxyz",
        name: "",
        onlyPassing: true,
        connect: true,
        near: "_agent",
        template: {
            type: "name_prefix_match",
            regexp: "^(.*)-near-self$",
        },
        service: "${match(1)}",
        failover: {
            nearestN: 3,
            datacenters: [
                "dc2",
                "dc3",
                "dc4",
            ],
        },
        dns: {
            ttl: "5m",
        },
    });
    
    import pulumi
    import pulumi_consul as consul
    
    # Creates a prepared query myquery.query.consul that finds the nearest
    # healthy myapp.service.consul instance that has the active tag and not
    # the standby tag.
    myapp_query = consul.PreparedQuery("myapp-query",
        name="myquery",
        datacenter="us-central1",
        token="abcd",
        stored_token="wxyz",
        only_passing=True,
        near="_agent",
        service="myapp",
        tags=[
            "active",
            "!standby",
        ],
        failover=consul.PreparedQueryFailoverArgs(
            nearest_n=3,
            datacenters=[
                "us-west1",
                "us-east-2",
                "asia-east1",
            ],
        ),
        dns=consul.PreparedQueryDnsArgs(
            ttl="30s",
        ))
    # Creates a Prepared Query Template that matches *-near-self.query.consul
    # and finds the nearest service that matches the glob character (e.g.
    # foo-near-self.query.consul will find the nearest healthy foo.service.consul).
    service_near_self = consul.PreparedQuery("service-near-self",
        datacenter="nyc1",
        token="abcd",
        stored_token="wxyz",
        name="",
        only_passing=True,
        connect=True,
        near="_agent",
        template=consul.PreparedQueryTemplateArgs(
            type="name_prefix_match",
            regexp="^(.*)-near-self$",
        ),
        service="${match(1)}",
        failover=consul.PreparedQueryFailoverArgs(
            nearest_n=3,
            datacenters=[
                "dc2",
                "dc3",
                "dc4",
            ],
        ),
        dns=consul.PreparedQueryDnsArgs(
            ttl="5m",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Creates a prepared query myquery.query.consul that finds the nearest
    		// healthy myapp.service.consul instance that has the active tag and not
    		// the standby tag.
    		_, err := consul.NewPreparedQuery(ctx, "myapp-query", &consul.PreparedQueryArgs{
    			Name:        pulumi.String("myquery"),
    			Datacenter:  pulumi.String("us-central1"),
    			Token:       pulumi.String("abcd"),
    			StoredToken: pulumi.String("wxyz"),
    			OnlyPassing: pulumi.Bool(true),
    			Near:        pulumi.String("_agent"),
    			Service:     pulumi.String("myapp"),
    			Tags: pulumi.StringArray{
    				pulumi.String("active"),
    				pulumi.String("!standby"),
    			},
    			Failover: &consul.PreparedQueryFailoverArgs{
    				NearestN: pulumi.Int(3),
    				Datacenters: pulumi.StringArray{
    					pulumi.String("us-west1"),
    					pulumi.String("us-east-2"),
    					pulumi.String("asia-east1"),
    				},
    			},
    			Dns: &consul.PreparedQueryDnsArgs{
    				Ttl: pulumi.String("30s"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Creates a Prepared Query Template that matches *-near-self.query.consul
    		// and finds the nearest service that matches the glob character (e.g.
    		// foo-near-self.query.consul will find the nearest healthy foo.service.consul).
    		_, err = consul.NewPreparedQuery(ctx, "service-near-self", &consul.PreparedQueryArgs{
    			Datacenter:  pulumi.String("nyc1"),
    			Token:       pulumi.String("abcd"),
    			StoredToken: pulumi.String("wxyz"),
    			Name:        pulumi.String(""),
    			OnlyPassing: pulumi.Bool(true),
    			Connect:     pulumi.Bool(true),
    			Near:        pulumi.String("_agent"),
    			Template: &consul.PreparedQueryTemplateArgs{
    				Type:   pulumi.String("name_prefix_match"),
    				Regexp: pulumi.String("^(.*)-near-self$"),
    			},
    			Service: pulumi.String("${match(1)}"),
    			Failover: &consul.PreparedQueryFailoverArgs{
    				NearestN: pulumi.Int(3),
    				Datacenters: pulumi.StringArray{
    					pulumi.String("dc2"),
    					pulumi.String("dc3"),
    					pulumi.String("dc4"),
    				},
    			},
    			Dns: &consul.PreparedQueryDnsArgs{
    				Ttl: pulumi.String("5m"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        // Creates a prepared query myquery.query.consul that finds the nearest
        // healthy myapp.service.consul instance that has the active tag and not
        // the standby tag.
        var myapp_query = new Consul.PreparedQuery("myapp-query", new()
        {
            Name = "myquery",
            Datacenter = "us-central1",
            Token = "abcd",
            StoredToken = "wxyz",
            OnlyPassing = true,
            Near = "_agent",
            Service = "myapp",
            Tags = new[]
            {
                "active",
                "!standby",
            },
            Failover = new Consul.Inputs.PreparedQueryFailoverArgs
            {
                NearestN = 3,
                Datacenters = new[]
                {
                    "us-west1",
                    "us-east-2",
                    "asia-east1",
                },
            },
            Dns = new Consul.Inputs.PreparedQueryDnsArgs
            {
                Ttl = "30s",
            },
        });
    
        // Creates a Prepared Query Template that matches *-near-self.query.consul
        // and finds the nearest service that matches the glob character (e.g.
        // foo-near-self.query.consul will find the nearest healthy foo.service.consul).
        var service_near_self = new Consul.PreparedQuery("service-near-self", new()
        {
            Datacenter = "nyc1",
            Token = "abcd",
            StoredToken = "wxyz",
            Name = "",
            OnlyPassing = true,
            Connect = true,
            Near = "_agent",
            Template = new Consul.Inputs.PreparedQueryTemplateArgs
            {
                Type = "name_prefix_match",
                Regexp = "^(.*)-near-self$",
            },
            Service = "${match(1)}",
            Failover = new Consul.Inputs.PreparedQueryFailoverArgs
            {
                NearestN = 3,
                Datacenters = new[]
                {
                    "dc2",
                    "dc3",
                    "dc4",
                },
            },
            Dns = new Consul.Inputs.PreparedQueryDnsArgs
            {
                Ttl = "5m",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.consul.PreparedQuery;
    import com.pulumi.consul.PreparedQueryArgs;
    import com.pulumi.consul.inputs.PreparedQueryFailoverArgs;
    import com.pulumi.consul.inputs.PreparedQueryDnsArgs;
    import com.pulumi.consul.inputs.PreparedQueryTemplateArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Creates a prepared query myquery.query.consul that finds the nearest
            // healthy myapp.service.consul instance that has the active tag and not
            // the standby tag.
            var myapp_query = new PreparedQuery("myapp-query", PreparedQueryArgs.builder()
                .name("myquery")
                .datacenter("us-central1")
                .token("abcd")
                .storedToken("wxyz")
                .onlyPassing(true)
                .near("_agent")
                .service("myapp")
                .tags(            
                    "active",
                    "!standby")
                .failover(PreparedQueryFailoverArgs.builder()
                    .nearestN(3)
                    .datacenters(                
                        "us-west1",
                        "us-east-2",
                        "asia-east1")
                    .build())
                .dns(PreparedQueryDnsArgs.builder()
                    .ttl("30s")
                    .build())
                .build());
    
            // Creates a Prepared Query Template that matches *-near-self.query.consul
            // and finds the nearest service that matches the glob character (e.g.
            // foo-near-self.query.consul will find the nearest healthy foo.service.consul).
            var service_near_self = new PreparedQuery("service-near-self", PreparedQueryArgs.builder()
                .datacenter("nyc1")
                .token("abcd")
                .storedToken("wxyz")
                .name("")
                .onlyPassing(true)
                .connect(true)
                .near("_agent")
                .template(PreparedQueryTemplateArgs.builder()
                    .type("name_prefix_match")
                    .regexp("^(.*)-near-self$")
                    .build())
                .service("${match(1)}")
                .failover(PreparedQueryFailoverArgs.builder()
                    .nearestN(3)
                    .datacenters(                
                        "dc2",
                        "dc3",
                        "dc4")
                    .build())
                .dns(PreparedQueryDnsArgs.builder()
                    .ttl("5m")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Creates a prepared query myquery.query.consul that finds the nearest
      # healthy myapp.service.consul instance that has the active tag and not
      # the standby tag.
      myapp-query:
        type: consul:PreparedQuery
        properties:
          name: myquery
          datacenter: us-central1
          token: abcd
          storedToken: wxyz
          onlyPassing: true
          near: _agent
          service: myapp
          tags:
            - active
            - '!standby'
          failover:
            nearestN: 3
            datacenters:
              - us-west1
              - us-east-2
              - asia-east1
          dns:
            ttl: 30s
      # Creates a Prepared Query Template that matches *-near-self.query.consul
      # and finds the nearest service that matches the glob character (e.g.
      # foo-near-self.query.consul will find the nearest healthy foo.service.consul).
      service-near-self:
        type: consul:PreparedQuery
        properties:
          datacenter: nyc1
          token: abcd
          storedToken: wxyz
          name:
          onlyPassing: true
          connect: true
          near: _agent
          template:
            type: name_prefix_match
            regexp: ^(.*)-near-self$
          service: ${match(1)}
          failover:
            nearestN: 3
            datacenters:
              - dc2
              - dc3
              - dc4
          dns:
            ttl: 5m
    

    Create PreparedQuery Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PreparedQuery(name: string, args: PreparedQueryArgs, opts?: CustomResourceOptions);
    @overload
    def PreparedQuery(resource_name: str,
                      args: PreparedQueryArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def PreparedQuery(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      service: Optional[str] = None,
                      only_passing: Optional[bool] = None,
                      datacenter: Optional[str] = None,
                      failover: Optional[PreparedQueryFailoverArgs] = None,
                      ignore_check_ids: Optional[Sequence[str]] = None,
                      name: Optional[str] = None,
                      near: Optional[str] = None,
                      dns: Optional[PreparedQueryDnsArgs] = None,
                      connect: Optional[bool] = None,
                      node_meta: Optional[Mapping[str, str]] = None,
                      service_meta: Optional[Mapping[str, str]] = None,
                      session: Optional[str] = None,
                      stored_token: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      template: Optional[PreparedQueryTemplateArgs] = None,
                      token: Optional[str] = None)
    func NewPreparedQuery(ctx *Context, name string, args PreparedQueryArgs, opts ...ResourceOption) (*PreparedQuery, error)
    public PreparedQuery(string name, PreparedQueryArgs args, CustomResourceOptions? opts = null)
    public PreparedQuery(String name, PreparedQueryArgs args)
    public PreparedQuery(String name, PreparedQueryArgs args, CustomResourceOptions options)
    
    type: consul:PreparedQuery
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PreparedQueryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PreparedQueryArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PreparedQueryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PreparedQueryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PreparedQueryArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var preparedQueryResource = new Consul.PreparedQuery("preparedQueryResource", new()
    {
        Service = "string",
        OnlyPassing = false,
        Datacenter = "string",
        Failover = new Consul.Inputs.PreparedQueryFailoverArgs
        {
            Datacenters = new[]
            {
                "string",
            },
            NearestN = 0,
            Targets = new[]
            {
                new Consul.Inputs.PreparedQueryFailoverTargetArgs
                {
                    Datacenter = "string",
                    Peer = "string",
                },
            },
        },
        IgnoreCheckIds = new[]
        {
            "string",
        },
        Name = "string",
        Near = "string",
        Dns = new Consul.Inputs.PreparedQueryDnsArgs
        {
            Ttl = "string",
        },
        Connect = false,
        NodeMeta = 
        {
            { "string", "string" },
        },
        ServiceMeta = 
        {
            { "string", "string" },
        },
        Session = "string",
        StoredToken = "string",
        Tags = new[]
        {
            "string",
        },
        Template = new Consul.Inputs.PreparedQueryTemplateArgs
        {
            Regexp = "string",
            Type = "string",
            RemoveEmptyTags = false,
        },
    });
    
    example, err := consul.NewPreparedQuery(ctx, "preparedQueryResource", &consul.PreparedQueryArgs{
    	Service:     pulumi.String("string"),
    	OnlyPassing: pulumi.Bool(false),
    	Datacenter:  pulumi.String("string"),
    	Failover: &consul.PreparedQueryFailoverArgs{
    		Datacenters: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		NearestN: pulumi.Int(0),
    		Targets: consul.PreparedQueryFailoverTargetArray{
    			&consul.PreparedQueryFailoverTargetArgs{
    				Datacenter: pulumi.String("string"),
    				Peer:       pulumi.String("string"),
    			},
    		},
    	},
    	IgnoreCheckIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	Near: pulumi.String("string"),
    	Dns: &consul.PreparedQueryDnsArgs{
    		Ttl: pulumi.String("string"),
    	},
    	Connect: pulumi.Bool(false),
    	NodeMeta: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ServiceMeta: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Session:     pulumi.String("string"),
    	StoredToken: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Template: &consul.PreparedQueryTemplateArgs{
    		Regexp:          pulumi.String("string"),
    		Type:            pulumi.String("string"),
    		RemoveEmptyTags: pulumi.Bool(false),
    	},
    })
    
    var preparedQueryResource = new PreparedQuery("preparedQueryResource", PreparedQueryArgs.builder()
        .service("string")
        .onlyPassing(false)
        .datacenter("string")
        .failover(PreparedQueryFailoverArgs.builder()
            .datacenters("string")
            .nearestN(0)
            .targets(PreparedQueryFailoverTargetArgs.builder()
                .datacenter("string")
                .peer("string")
                .build())
            .build())
        .ignoreCheckIds("string")
        .name("string")
        .near("string")
        .dns(PreparedQueryDnsArgs.builder()
            .ttl("string")
            .build())
        .connect(false)
        .nodeMeta(Map.of("string", "string"))
        .serviceMeta(Map.of("string", "string"))
        .session("string")
        .storedToken("string")
        .tags("string")
        .template(PreparedQueryTemplateArgs.builder()
            .regexp("string")
            .type("string")
            .removeEmptyTags(false)
            .build())
        .build());
    
    prepared_query_resource = consul.PreparedQuery("preparedQueryResource",
        service="string",
        only_passing=False,
        datacenter="string",
        failover=consul.PreparedQueryFailoverArgs(
            datacenters=["string"],
            nearest_n=0,
            targets=[consul.PreparedQueryFailoverTargetArgs(
                datacenter="string",
                peer="string",
            )],
        ),
        ignore_check_ids=["string"],
        name="string",
        near="string",
        dns=consul.PreparedQueryDnsArgs(
            ttl="string",
        ),
        connect=False,
        node_meta={
            "string": "string",
        },
        service_meta={
            "string": "string",
        },
        session="string",
        stored_token="string",
        tags=["string"],
        template=consul.PreparedQueryTemplateArgs(
            regexp="string",
            type="string",
            remove_empty_tags=False,
        ))
    
    const preparedQueryResource = new consul.PreparedQuery("preparedQueryResource", {
        service: "string",
        onlyPassing: false,
        datacenter: "string",
        failover: {
            datacenters: ["string"],
            nearestN: 0,
            targets: [{
                datacenter: "string",
                peer: "string",
            }],
        },
        ignoreCheckIds: ["string"],
        name: "string",
        near: "string",
        dns: {
            ttl: "string",
        },
        connect: false,
        nodeMeta: {
            string: "string",
        },
        serviceMeta: {
            string: "string",
        },
        session: "string",
        storedToken: "string",
        tags: ["string"],
        template: {
            regexp: "string",
            type: "string",
            removeEmptyTags: false,
        },
    });
    
    type: consul:PreparedQuery
    properties:
        connect: false
        datacenter: string
        dns:
            ttl: string
        failover:
            datacenters:
                - string
            nearestN: 0
            targets:
                - datacenter: string
                  peer: string
        ignoreCheckIds:
            - string
        name: string
        near: string
        nodeMeta:
            string: string
        onlyPassing: false
        service: string
        serviceMeta:
            string: string
        session: string
        storedToken: string
        tags:
            - string
        template:
            regexp: string
            removeEmptyTags: false
            type: string
    

    PreparedQuery Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The PreparedQuery resource accepts the following input properties:

    Service string
    The name of the service to query
    Connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Dns PreparedQueryDns
    Settings for controlling the DNS response details.
    Failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    IgnoreCheckIds List<string>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    Name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    Near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    NodeMeta Dictionary<string, string>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    OnlyPassing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    ServiceMeta Dictionary<string, string>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    Session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    StoredToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    Tags List<string>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    Template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    Token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Service string
    The name of the service to query
    Connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Dns PreparedQueryDnsArgs
    Settings for controlling the DNS response details.
    Failover PreparedQueryFailoverArgs
    Options for controlling behavior when no healthy nodes are available in the local DC.
    IgnoreCheckIds []string
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    Name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    Near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    NodeMeta map[string]string
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    OnlyPassing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    ServiceMeta map[string]string
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    Session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    StoredToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    Tags []string
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    Template PreparedQueryTemplateArgs
    Query templating options. This is used to make a single prepared query respond to many different requests
    Token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    service String
    The name of the service to query
    connect Boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDns
    Settings for controlling the DNS response details.
    failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds List<String>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name String
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near String
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta Map<String,String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing Boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    serviceMeta Map<String,String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session String
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken String
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags List<String>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    token String
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    service string
    The name of the service to query
    connect boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDns
    Settings for controlling the DNS response details.
    failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds string[]
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta {[key: string]: string}
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    serviceMeta {[key: string]: string}
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags string[]
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    service str
    The name of the service to query
    connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDnsArgs
    Settings for controlling the DNS response details.
    failover PreparedQueryFailoverArgs
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignore_check_ids Sequence[str]
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name str
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near str
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    node_meta Mapping[str, str]
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    only_passing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    service_meta Mapping[str, str]
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session str
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    stored_token str
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags Sequence[str]
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplateArgs
    Query templating options. This is used to make a single prepared query respond to many different requests
    token str
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    service String
    The name of the service to query
    connect Boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns Property Map
    Settings for controlling the DNS response details.
    failover Property Map
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds List<String>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name String
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near String
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta Map<String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing Boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    serviceMeta Map<String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session String
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken String
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags List<String>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template Property Map
    Query templating options. This is used to make a single prepared query respond to many different requests
    token String
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PreparedQuery resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PreparedQuery Resource

    Get an existing PreparedQuery resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PreparedQueryState, opts?: CustomResourceOptions): PreparedQuery
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connect: Optional[bool] = None,
            datacenter: Optional[str] = None,
            dns: Optional[PreparedQueryDnsArgs] = None,
            failover: Optional[PreparedQueryFailoverArgs] = None,
            ignore_check_ids: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            near: Optional[str] = None,
            node_meta: Optional[Mapping[str, str]] = None,
            only_passing: Optional[bool] = None,
            service: Optional[str] = None,
            service_meta: Optional[Mapping[str, str]] = None,
            session: Optional[str] = None,
            stored_token: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            template: Optional[PreparedQueryTemplateArgs] = None,
            token: Optional[str] = None) -> PreparedQuery
    func GetPreparedQuery(ctx *Context, name string, id IDInput, state *PreparedQueryState, opts ...ResourceOption) (*PreparedQuery, error)
    public static PreparedQuery Get(string name, Input<string> id, PreparedQueryState? state, CustomResourceOptions? opts = null)
    public static PreparedQuery get(String name, Output<String> id, PreparedQueryState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Dns PreparedQueryDns
    Settings for controlling the DNS response details.
    Failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    IgnoreCheckIds List<string>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    Name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    Near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    NodeMeta Dictionary<string, string>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    OnlyPassing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    Service string
    The name of the service to query
    ServiceMeta Dictionary<string, string>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    Session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    StoredToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    Tags List<string>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    Template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    Token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Dns PreparedQueryDnsArgs
    Settings for controlling the DNS response details.
    Failover PreparedQueryFailoverArgs
    Options for controlling behavior when no healthy nodes are available in the local DC.
    IgnoreCheckIds []string
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    Name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    Near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    NodeMeta map[string]string
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    OnlyPassing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    Service string
    The name of the service to query
    ServiceMeta map[string]string
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    Session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    StoredToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    Tags []string
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    Template PreparedQueryTemplateArgs
    Query templating options. This is used to make a single prepared query respond to many different requests
    Token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    connect Boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDns
    Settings for controlling the DNS response details.
    failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds List<String>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name String
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near String
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta Map<String,String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing Boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    service String
    The name of the service to query
    serviceMeta Map<String,String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session String
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken String
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags List<String>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    token String
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    connect boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDns
    Settings for controlling the DNS response details.
    failover PreparedQueryFailover
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds string[]
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name string
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near string
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta {[key: string]: string}
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    service string
    The name of the service to query
    serviceMeta {[key: string]: string}
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session string
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken string
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags string[]
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplate
    Query templating options. This is used to make a single prepared query respond to many different requests
    token string
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    connect bool
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns PreparedQueryDnsArgs
    Settings for controlling the DNS response details.
    failover PreparedQueryFailoverArgs
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignore_check_ids Sequence[str]
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name str
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near str
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    node_meta Mapping[str, str]
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    only_passing bool
    When true, the prepared query will only return nodes with passing health checks in the result.
    service str
    The name of the service to query
    service_meta Mapping[str, str]
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session str
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    stored_token str
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags Sequence[str]
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template PreparedQueryTemplateArgs
    Query templating options. This is used to make a single prepared query respond to many different requests
    token str
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    connect Boolean
    When true the prepared query will return connect proxy services for a queried service. Conditions such as tags in the prepared query will be matched against the proxy service. Defaults to false.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    dns Property Map
    Settings for controlling the DNS response details.
    failover Property Map
    Options for controlling behavior when no healthy nodes are available in the local DC.
    ignoreCheckIds List<String>
    Specifies a list of check IDs that should be ignored when filtering unhealthy instances. This is mostly useful in an emergency or as a temporary measure when a health check is found to be unreliable. Being able to ignore it in centrally-defined queries can be simpler than de-registering the check as an interim solution until the check can be fixed.
    name String
    The name of the prepared query. Used to identify the prepared query during requests. Can be specified as an empty string to configure the query as a catch-all.
    near String
    Allows specifying the name of a node to sort results near using Consul's distance sorting and network coordinates. The magic _agent value can be used to always sort nearest the node servicing the request.
    nodeMeta Map<String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to nodes with the given metadata values present.
    onlyPassing Boolean
    When true, the prepared query will only return nodes with passing health checks in the result.
    service String
    The name of the service to query
    serviceMeta Map<String>
    Specifies a list of user-defined key/value pairs that will be used for filtering the query results to services with the given metadata values present.
    session String
    The name of the Consul session to tie this query's lifetime to. This is an advanced parameter that should not be used without a complete understanding of Consul sessions and the implications of their use (it is recommended to leave this blank in nearly all cases). If this parameter is omitted the query will not expire.
    storedToken String
    The ACL token to store with the prepared query. This token will be used by default whenever the query is executed.
    tags List<String>
    The list of required and/or disallowed tags. If a tag is in this list it must be present. If the tag is preceded with a "!" then it is disallowed.
    template Property Map
    Query templating options. This is used to make a single prepared query respond to many different requests
    token String
    The ACL token to use when saving the prepared query. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Supporting Types

    PreparedQueryDns, PreparedQueryDnsArgs

    Ttl string
    The TTL to send when returning DNS results.
    Ttl string
    The TTL to send when returning DNS results.
    ttl String
    The TTL to send when returning DNS results.
    ttl string
    The TTL to send when returning DNS results.
    ttl str
    The TTL to send when returning DNS results.
    ttl String
    The TTL to send when returning DNS results.

    PreparedQueryFailover, PreparedQueryFailoverArgs

    Datacenters List<string>
    Remote datacenters to return results from.
    NearestN int
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    Targets List<PreparedQueryFailoverTarget>
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.
    Datacenters []string
    Remote datacenters to return results from.
    NearestN int
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    Targets []PreparedQueryFailoverTarget
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.
    datacenters List<String>
    Remote datacenters to return results from.
    nearestN Integer
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    targets List<PreparedQueryFailoverTarget>
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.
    datacenters string[]
    Remote datacenters to return results from.
    nearestN number
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    targets PreparedQueryFailoverTarget[]
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.
    datacenters Sequence[str]
    Remote datacenters to return results from.
    nearest_n int
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    targets Sequence[PreparedQueryFailoverTarget]
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.
    datacenters List<String>
    Remote datacenters to return results from.
    nearestN Number
    Return results from this many datacenters, sorted in ascending order of estimated RTT.
    targets List<Property Map>
    Specifies a sequential list of remote datacenters and cluster peers to failover to if there are no healthy service instances in the local datacenter. This option cannot be used with nearest_n or datacenters.

    PreparedQueryFailoverTarget, PreparedQueryFailoverTargetArgs

    Datacenter string
    Specifies a WAN federated datacenter to forward the query to.
    Peer string
    Specifies a cluster peer to use for failover.
    Datacenter string
    Specifies a WAN federated datacenter to forward the query to.
    Peer string
    Specifies a cluster peer to use for failover.
    datacenter String
    Specifies a WAN federated datacenter to forward the query to.
    peer String
    Specifies a cluster peer to use for failover.
    datacenter string
    Specifies a WAN federated datacenter to forward the query to.
    peer string
    Specifies a cluster peer to use for failover.
    datacenter str
    Specifies a WAN federated datacenter to forward the query to.
    peer str
    Specifies a cluster peer to use for failover.
    datacenter String
    Specifies a WAN federated datacenter to forward the query to.
    peer String
    Specifies a cluster peer to use for failover.

    PreparedQueryTemplate, PreparedQueryTemplateArgs

    Regexp string
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    Type string
    The type of template matching to perform. Currently only name_prefix_match is supported.
    RemoveEmptyTags bool
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.
    Regexp string
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    Type string
    The type of template matching to perform. Currently only name_prefix_match is supported.
    RemoveEmptyTags bool
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.
    regexp String
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    type String
    The type of template matching to perform. Currently only name_prefix_match is supported.
    removeEmptyTags Boolean
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.
    regexp string
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    type string
    The type of template matching to perform. Currently only name_prefix_match is supported.
    removeEmptyTags boolean
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.
    regexp str
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    type str
    The type of template matching to perform. Currently only name_prefix_match is supported.
    remove_empty_tags bool
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.
    regexp String
    The regular expression to match with. When using name_prefix_match, this regex is applied against the query name.
    type String
    The type of template matching to perform. Currently only name_prefix_match is supported.
    removeEmptyTags Boolean
    If set to true, will cause the tags list inside the service structure to be stripped of any empty strings.

    Import

    $ pulumi import consul:index/preparedQuery:PreparedQuery my_service 71ecfb82-717a-4258-b4b6-2fb75144d856
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    HashiCorp Consul pulumi/pulumi-consul
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the consul Terraform Provider.
    consul logo
    Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi