sdk/java/src/main/java/com/pulumi/ovh/IpLoadBalancing/HttpFarm.java
// *** 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.HttpFarmArgs;
import com.pulumi.ovh.IpLoadBalancing.inputs.HttpFarmState;
import com.pulumi.ovh.IpLoadBalancing.outputs.HttpFarmProbe;
import com.pulumi.ovh.Utilities;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Creates a HTTP backend server group (farm) to be used by loadbalancing frontend(s)
 * 
 * ## 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 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()        
 *             .displayName(&#34;ingress-8080-gra&#34;)
 *             .serviceName(lb.applyValue(getIpLoadBalancingResult -&gt; getIpLoadBalancingResult.serviceName()))
 *             .zone(&#34;GRA&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="ovh:IpLoadBalancing/httpFarm:HttpFarm")
public class HttpFarm extends com.pulumi.resources.CustomResource {
    /**
     * Load balancing algorithm. `roundrobin` if null (`first`, `leastconn`, `roundrobin`, `source`)
     * 
     */
    @Export(name="balance", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> balance;

    /**
     * @return Load balancing algorithm. `roundrobin` if null (`first`, `leastconn`, `roundrobin`, `source`)
     * 
     */
    public Output<Optional<String>> balance() {
        return Codegen.optional(this.balance);
    }
    /**
     * Readable label for loadbalancer farm
     * 
     */
    @Export(name="displayName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> displayName;

    /**
     * @return Readable label for loadbalancer farm
     * 
     */
    public Output<Optional<String>> displayName() {
        return Codegen.optional(this.displayName);
    }
    /**
     * Port for backends to receive traffic on.
     * 
     */
    @Export(name="port", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> port;

    /**
     * @return Port for backends to receive traffic on.
     * 
     */
    public Output<Optional<Integer>> port() {
        return Codegen.optional(this.port);
    }
    /**
     * define a backend healthcheck probe
     * 
     */
    @Export(name="probe", refs={HttpFarmProbe.class}, tree="[0]")
    private Output</* @Nullable */ HttpFarmProbe> probe;

    /**
     * @return define a backend healthcheck probe
     * 
     */
    public Output<Optional<HttpFarmProbe>> probe() {
        return Codegen.optional(this.probe);
    }
    /**
     * 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;
    }
    /**
     * Stickiness type. No stickiness if null (`sourceIp`, `cookie`)
     * 
     */
    @Export(name="stickiness", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> stickiness;

    /**
     * @return Stickiness type. No stickiness if null (`sourceIp`, `cookie`)
     * 
     */
    public Output<Optional<String>> stickiness() {
        return Codegen.optional(this.stickiness);
    }
    /**
     * Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
     * 
     */
    @Export(name="vrackNetworkId", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> vrackNetworkId;

    /**
     * @return Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
     * 
     */
    public Output<Optional<Integer>> vrackNetworkId() {
        return Codegen.optional(this.vrackNetworkId);
    }
    /**
     * Zone where the farm will be defined (ie. `GRA`, `BHS` also supports `ALL`)
     * 
     */
    @Export(name="zone", refs={String.class}, tree="[0]")
    private Output<String> zone;

    /**
     * @return Zone where the farm will be defined (ie. `GRA`, `BHS` also supports `ALL`)
     * 
     */
    public Output<String> zone() {
        return this.zone;
    }

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

    private HttpFarm(String name, Output<String> id, @Nullable HttpFarmState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("ovh:IpLoadBalancing/httpFarm:HttpFarm", 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 HttpFarm get(String name, Output<String> id, @Nullable HttpFarmState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new HttpFarm(name, id, state, options);
    }
}
