All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.consul.ConfigEntryServiceResolver Maven / Gradle / Ivy

There is a newer version: 3.13.0-alpha.1732771629
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.consul;

import com.pulumi.consul.ConfigEntryServiceResolverArgs;
import com.pulumi.consul.Utilities;
import com.pulumi.consul.inputs.ConfigEntryServiceResolverState;
import com.pulumi.consul.outputs.ConfigEntryServiceResolverFailover;
import com.pulumi.consul.outputs.ConfigEntryServiceResolverLoadBalancer;
import com.pulumi.consul.outputs.ConfigEntryServiceResolverRedirect;
import com.pulumi.consul.outputs.ConfigEntryServiceResolverSubset;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The `consul.ConfigEntryServiceResolver` resource configures a [service resolver](https://developer.hashicorp.com/consul/docs/connect/config-entries/service-resolver) that creates named subsets of service instances and define their behavior when satisfying upstream requests.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.consul.ConfigEntryServiceResolver;
 * import com.pulumi.consul.ConfigEntryServiceResolverArgs;
 * import com.pulumi.consul.inputs.ConfigEntryServiceResolverFailoverArgs;
 * import com.pulumi.consul.inputs.ConfigEntryServiceResolverRedirectArgs;
 * import com.pulumi.consul.inputs.ConfigEntryServiceResolverSubsetArgs;
 * 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) {
 *         var web = new ConfigEntryServiceResolver("web", ConfigEntryServiceResolverArgs.builder()        
 *             .connectTimeout("15s")
 *             .defaultSubset("v1")
 *             .failovers(            
 *                 ConfigEntryServiceResolverFailoverArgs.builder()
 *                     .datacenters("dc2")
 *                     .subsetName("v2")
 *                     .build(),
 *                 ConfigEntryServiceResolverFailoverArgs.builder()
 *                     .datacenters(                    
 *                         "dc3",
 *                         "dc4")
 *                     .subsetName("*")
 *                     .build())
 *             .redirects(ConfigEntryServiceResolverRedirectArgs.builder()
 *                 .datacenter("dc2")
 *                 .service("web")
 *                 .build())
 *             .subsets(            
 *                 ConfigEntryServiceResolverSubsetArgs.builder()
 *                     .filter("Service.Meta.version == v1")
 *                     .name("v1")
 *                     .build(),
 *                 ConfigEntryServiceResolverSubsetArgs.builder()
 *                     .filter("Service.Meta.version == v2")
 *                     .name("v2")
 *                     .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="consul:index/configEntryServiceResolver:ConfigEntryServiceResolver")
public class ConfigEntryServiceResolver extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the timeout duration for establishing new network connections to this service.
     * 
     */
    @Export(name="connectTimeout", refs={String.class}, tree="[0]")
    private Output connectTimeout;

    /**
     * @return Specifies the timeout duration for establishing new network connections to this service.
     * 
     */
    public Output> connectTimeout() {
        return Codegen.optional(this.connectTimeout);
    }
    /**
     * Specifies a defined subset of service instances to use when no explicit subset is requested. If this parameter is not specified, Consul uses the unnamed default subset.
     * 
     */
    @Export(name="defaultSubset", refs={String.class}, tree="[0]")
    private Output defaultSubset;

    /**
     * @return Specifies a defined subset of service instances to use when no explicit subset is requested. If this parameter is not specified, Consul uses the unnamed default subset.
     * 
     */
    public Output> defaultSubset() {
        return Codegen.optional(this.defaultSubset);
    }
    /**
     * Specifies controls for rerouting traffic to an alternate pool of service instances if the target service fails.
     * 
     */
    @Export(name="failovers", refs={List.class,ConfigEntryServiceResolverFailover.class}, tree="[0,1]")
    private Output> failovers;

    /**
     * @return Specifies controls for rerouting traffic to an alternate pool of service instances if the target service fails.
     * 
     */
    public Output>> failovers() {
        return Codegen.optional(this.failovers);
    }
    /**
     * Specifies the load balancing policy and configuration for services issuing requests to this upstream.
     * 
     */
    @Export(name="loadBalancers", refs={List.class,ConfigEntryServiceResolverLoadBalancer.class}, tree="[0,1]")
    private Output> loadBalancers;

    /**
     * @return Specifies the load balancing policy and configuration for services issuing requests to this upstream.
     * 
     */
    public Output>> loadBalancers() {
        return Codegen.optional(this.loadBalancers);
    }
    /**
     * Specifies key-value pairs to add to the KV store.
     * 
     */
    @Export(name="meta", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output> meta;

    /**
     * @return Specifies key-value pairs to add to the KV store.
     * 
     */
    public Output>> meta() {
        return Codegen.optional(this.meta);
    }
    /**
     * Name of subset.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output name;

    /**
     * @return Name of subset.
     * 
     */
    public Output name() {
        return this.name;
    }
    /**
     * Specifies the namespace at the failover location where the failover services are deployed.
     * 
     */
    @Export(name="namespace", refs={String.class}, tree="[0]")
    private Output namespace;

    /**
     * @return Specifies the namespace at the failover location where the failover services are deployed.
     * 
     */
    public Output> namespace() {
        return Codegen.optional(this.namespace);
    }
    /**
     * Specifies the admin partition within the same datacenter to use for the failover target. If empty, the default partition is used.
     * 
     */
    @Export(name="partition", refs={String.class}, tree="[0]")
    private Output partition;

    /**
     * @return Specifies the admin partition within the same datacenter to use for the failover target. If empty, the default partition is used.
     * 
     */
    public Output> partition() {
        return Codegen.optional(this.partition);
    }
    /**
     * Specifies redirect instructions for local service traffic so that services deployed to a different network location resolve the upstream request instead.
     * 
     */
    @Export(name="redirects", refs={List.class,ConfigEntryServiceResolverRedirect.class}, tree="[0,1]")
    private Output> redirects;

    /**
     * @return Specifies redirect instructions for local service traffic so that services deployed to a different network location resolve the upstream request instead.
     * 
     */
    public Output>> redirects() {
        return Codegen.optional(this.redirects);
    }
    /**
     * Specifies the timeout duration for receiving an HTTP response from this service.
     * 
     */
    @Export(name="requestTimeout", refs={String.class}, tree="[0]")
    private Output requestTimeout;

    /**
     * @return Specifies the timeout duration for receiving an HTTP response from this service.
     * 
     */
    public Output> requestTimeout() {
        return Codegen.optional(this.requestTimeout);
    }
    /**
     * Specifies names for custom service subsets and the conditions under which service instances belong to each subset.
     * 
     */
    @Export(name="subsets", refs={List.class,ConfigEntryServiceResolverSubset.class}, tree="[0,1]")
    private Output> subsets;

    /**
     * @return Specifies names for custom service subsets and the conditions under which service instances belong to each subset.
     * 
     */
    public Output>> subsets() {
        return Codegen.optional(this.subsets);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ConfigEntryServiceResolver(String name) {
        this(name, ConfigEntryServiceResolverArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ConfigEntryServiceResolver(String name, @Nullable ConfigEntryServiceResolverArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ConfigEntryServiceResolver(String name, @Nullable ConfigEntryServiceResolverArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/configEntryServiceResolver:ConfigEntryServiceResolver", name, args == null ? ConfigEntryServiceResolverArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ConfigEntryServiceResolver(String name, Output id, @Nullable ConfigEntryServiceResolverState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("consul:index/configEntryServiceResolver:ConfigEntryServiceResolver", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ConfigEntryServiceResolver get(String name, Output id, @Nullable ConfigEntryServiceResolverState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ConfigEntryServiceResolver(name, id, state, options);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy