sdk/java/src/main/java/com/pulumi/ovh/IpLoadBalancing/HttpFarmServer.java
<reponame>lbrlabs/pulumi-ovh// *** 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.ovh.IpLoadBalancing;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.ovh.IpLoadBalancing.HttpFarmServerArgs;
import com.pulumi.ovh.IpLoadBalancing.inputs.HttpFarmServerState;
import com.pulumi.ovh.Utilities;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Creates a backend server entry linked to HTTP loadbalancing group (farm)
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.ovh.IpLoadBalancing.IpLoadBalancingFunctions;
 * import com.pulumi.ovh.IpLoadBalancing.inputs.GetIpLoadBalancingArgs;
 * import com.pulumi.ovh.IpLoadBalancing.HttpFarm;
 * import com.pulumi.ovh.IpLoadBalancing.HttpFarmArgs;
 * import com.pulumi.ovh.IpLoadBalancing.HttpFarmServer;
 * import com.pulumi.ovh.IpLoadBalancing.HttpFarmServerArgs;
 * 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) {
 *         final var lb = IpLoadBalancingFunctions.getIpLoadBalancing(GetIpLoadBalancingArgs.builder()
 *             .serviceName(&#34;ip-1.2.3.4&#34;)
 *             .state(&#34;ok&#34;)
 *             .build());
 * 
 *         var farmname = new HttpFarm(&#34;farmname&#34;, HttpFarmArgs.builder()        
 *             .port(8080)
 *             .serviceName(lb.applyValue(getIpLoadBalancingResult -&gt; getIpLoadBalancingResult.serviceName()))
 *             .zone(&#34;all&#34;)
 *             .build());
 * 
 *         var backend = new HttpFarmServer(&#34;backend&#34;, HttpFarmServerArgs.builder()        
 *             .address(&#34;4.5.6.7&#34;)
 *             .backup(true)
 *             .displayName(&#34;mybackend&#34;)
 *             .farmId(farmname.id())
 *             .port(80)
 *             .probe(true)
 *             .proxyProtocolVersion(&#34;v2&#34;)
 *             .serviceName(lb.applyValue(getIpLoadBalancingResult -&gt; getIpLoadBalancingResult.serviceName()))
 *             .ssl(false)
 *             .status(&#34;active&#34;)
 *             .weight(2)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="ovh:IpLoadBalancing/httpFarmServer:HttpFarmServer")
public class HttpFarmServer extends com.pulumi.resources.CustomResource {
    /**
     * Address of the backend server (IP from either internal or OVHcloud network)
     * 
     */
    @Export(name="address", refs={String.class}, tree="[0]")
    private Output<String> address;

    /**
     * @return Address of the backend server (IP from either internal or OVHcloud network)
     * 
     */
    public Output<String> address() {
        return this.address;
    }
    /**
     * is it a backup server used in case of failure of all the non-backup backends
     * 
     */
    @Export(name="backup", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> backup;

    /**
     * @return is it a backup server used in case of failure of all the non-backup backends
     * 
     */
    public Output<Optional<Boolean>> backup() {
        return Codegen.optional(this.backup);
    }
    @Export(name="chain", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> chain;

    public Output<Optional<String>> chain() {
        return Codegen.optional(this.chain);
    }
    /**
     * Value of the stickiness cookie used for this backend.
     * 
     */
    @Export(name="cookie", refs={String.class}, tree="[0]")
    private Output<String> cookie;

    /**
     * @return Value of the stickiness cookie used for this backend.
     * 
     */
    public Output<String> cookie() {
        return this.cookie;
    }
    /**
     * Label for the server
     * 
     */
    @Export(name="displayName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> displayName;

    /**
     * @return Label for the server
     * 
     */
    public Output<Optional<String>> displayName() {
        return Codegen.optional(this.displayName);
    }
    /**
     * ID of the farm this server is attached to
     * 
     */
    @Export(name="farmId", refs={Integer.class}, tree="[0]")
    private Output<Integer> farmId;

    /**
     * @return ID of the farm this server is attached to
     * 
     */
    public Output<Integer> farmId() {
        return this.farmId;
    }
    /**
     * enable action when backend marked down. (`shutdown-sessions`)
     * 
     */
    @Export(name="onMarkedDown", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> onMarkedDown;

    /**
     * @return enable action when backend marked down. (`shutdown-sessions`)
     * 
     */
    public Output<Optional<String>> onMarkedDown() {
        return Codegen.optional(this.onMarkedDown);
    }
    /**
     * Port that backend will respond on
     * 
     */
    @Export(name="port", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> port;

    /**
     * @return Port that backend will respond on
     * 
     */
    public Output<Optional<Integer>> port() {
        return Codegen.optional(this.port);
    }
    /**
     * defines if backend will be probed to determine health and keep as active in farm if healthy
     * 
     */
    @Export(name="probe", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> probe;

    /**
     * @return defines if backend will be probed to determine health and keep as active in farm if healthy
     * 
     */
    public Output<Optional<Boolean>> probe() {
        return Codegen.optional(this.probe);
    }
    /**
     * version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (`v1`, `v2`, `v2-ssl`, `v2-ssl-cn`)
     * 
     */
    @Export(name="proxyProtocolVersion", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> proxyProtocolVersion;

    /**
     * @return version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (`v1`, `v2`, `v2-ssl`, `v2-ssl-cn`)
     * 
     */
    public Output<Optional<String>> proxyProtocolVersion() {
        return Codegen.optional(this.proxyProtocolVersion);
    }
    /**
     * The internal name of your IP load balancing
     * 
     */
    @Export(name="serviceName", refs={String.class}, tree="[0]")
    private Output<String> serviceName;

    /**
     * @return The internal name of your IP load balancing
     * 
     */
    public Output<String> serviceName() {
        return this.serviceName;
    }
    /**
     * is the connection ciphered with SSL (TLS)
     * 
     */
    @Export(name="ssl", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> ssl;

    /**
     * @return is the connection ciphered with SSL (TLS)
     * 
     */
    public Output<Optional<Boolean>> ssl() {
        return Codegen.optional(this.ssl);
    }
    /**
     * backend status - `active` or `inactive`
     * 
     */
    @Export(name="status", refs={String.class}, tree="[0]")
    private Output<String> status;

    /**
     * @return backend status - `active` or `inactive`
     * 
     */
    public Output<String> status() {
        return this.status;
    }
    /**
     * used in loadbalancing algorithm
     * 
     */
    @Export(name="weight", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> weight;

    /**
     * @return used in loadbalancing algorithm
     * 
     */
    public Output<Optional<Integer>> weight() {
        return Codegen.optional(this.weight);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public HttpFarmServer(String name) {
        this(name, HttpFarmServerArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public HttpFarmServer(String name, HttpFarmServerArgs 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 HttpFarmServer(String name, HttpFarmServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("ovh:IpLoadBalancing/httpFarmServer:HttpFarmServer", name, args == null ? HttpFarmServerArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private HttpFarmServer(String name, Output<String> id, @Nullable HttpFarmServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("ovh:IpLoadBalancing/httpFarmServer:HttpFarmServer", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 HttpFarmServer get(String name, Output<String> id, @Nullable HttpFarmServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new HttpFarmServer(name, id, state, options);
    }
}
