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

com.pulumi.digitalocean.kotlin.LoadBalancerArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.digitalocean.kotlin

import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.LoadBalancerArgs.builder
import com.pulumi.digitalocean.kotlin.enums.Algorithm
import com.pulumi.digitalocean.kotlin.enums.Region
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerDomainArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerDomainArgsBuilder
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerFirewallArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerFirewallArgsBuilder
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerForwardingRuleArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerForwardingRuleArgsBuilder
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerGlbSettingsArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerGlbSettingsArgsBuilder
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerHealthcheckArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerHealthcheckArgsBuilder
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerStickySessionsArgs
import com.pulumi.digitalocean.kotlin.inputs.LoadBalancerStickySessionsArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a DigitalOcean Load Balancer resource. This can be used to create,
 * modify, and delete Load Balancers.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as digitalocean from "@pulumi/digitalocean";
 * const web = new digitalocean.Droplet("web", {
 *     name: "web-1",
 *     size: digitalocean.DropletSlug.DropletS1VCPU1GB,
 *     image: "ubuntu-18-04-x64",
 *     region: digitalocean.Region.NYC3,
 * });
 * const _public = new digitalocean.LoadBalancer("public", {
 *     name: "loadbalancer-1",
 *     region: digitalocean.Region.NYC3,
 *     forwardingRules: [{
 *         entryPort: 80,
 *         entryProtocol: "http",
 *         targetPort: 80,
 *         targetProtocol: "http",
 *     }],
 *     healthcheck: {
 *         port: 22,
 *         protocol: "tcp",
 *     },
 *     dropletIds: [web.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_digitalocean as digitalocean
 * web = digitalocean.Droplet("web",
 *     name="web-1",
 *     size=digitalocean.DropletSlug.DROPLET_S1_VCPU1_GB,
 *     image="ubuntu-18-04-x64",
 *     region=digitalocean.Region.NYC3)
 * public = digitalocean.LoadBalancer("public",
 *     name="loadbalancer-1",
 *     region=digitalocean.Region.NYC3,
 *     forwarding_rules=[{
 *         "entry_port": 80,
 *         "entry_protocol": "http",
 *         "target_port": 80,
 *         "target_protocol": "http",
 *     }],
 *     healthcheck={
 *         "port": 22,
 *         "protocol": "tcp",
 *     },
 *     droplet_ids=[web.id])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using DigitalOcean = Pulumi.DigitalOcean;
 * return await Deployment.RunAsync(() =>
 * {
 *     var web = new DigitalOcean.Droplet("web", new()
 *     {
 *         Name = "web-1",
 *         Size = DigitalOcean.DropletSlug.DropletS1VCPU1GB,
 *         Image = "ubuntu-18-04-x64",
 *         Region = DigitalOcean.Region.NYC3,
 *     });
 *     var @public = new DigitalOcean.LoadBalancer("public", new()
 *     {
 *         Name = "loadbalancer-1",
 *         Region = DigitalOcean.Region.NYC3,
 *         ForwardingRules = new[]
 *         {
 *             new DigitalOcean.Inputs.LoadBalancerForwardingRuleArgs
 *             {
 *                 EntryPort = 80,
 *                 EntryProtocol = "http",
 *                 TargetPort = 80,
 *                 TargetProtocol = "http",
 *             },
 *         },
 *         Healthcheck = new DigitalOcean.Inputs.LoadBalancerHealthcheckArgs
 *         {
 *             Port = 22,
 *             Protocol = "tcp",
 *         },
 *         DropletIds = new[]
 *         {
 *             web.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		web, err := digitalocean.NewDroplet(ctx, "web", &digitalocean.DropletArgs{
 * 			Name:   pulumi.String("web-1"),
 * 			Size:   pulumi.String(digitalocean.DropletSlugDropletS1VCPU1GB),
 * 			Image:  pulumi.String("ubuntu-18-04-x64"),
 * 			Region: pulumi.String(digitalocean.RegionNYC3),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = digitalocean.NewLoadBalancer(ctx, "public", &digitalocean.LoadBalancerArgs{
 * 			Name:   pulumi.String("loadbalancer-1"),
 * 			Region: pulumi.String(digitalocean.RegionNYC3),
 * 			ForwardingRules: digitalocean.LoadBalancerForwardingRuleArray{
 * 				&digitalocean.LoadBalancerForwardingRuleArgs{
 * 					EntryPort:      pulumi.Int(80),
 * 					EntryProtocol:  pulumi.String("http"),
 * 					TargetPort:     pulumi.Int(80),
 * 					TargetProtocol: pulumi.String("http"),
 * 				},
 * 			},
 * 			Healthcheck: &digitalocean.LoadBalancerHealthcheckArgs{
 * 				Port:     pulumi.Int(22),
 * 				Protocol: pulumi.String("tcp"),
 * 			},
 * 			DropletIds: pulumi.IntArray{
 * 				web.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.digitalocean.Droplet;
 * import com.pulumi.digitalocean.DropletArgs;
 * import com.pulumi.digitalocean.LoadBalancer;
 * import com.pulumi.digitalocean.LoadBalancerArgs;
 * import com.pulumi.digitalocean.inputs.LoadBalancerForwardingRuleArgs;
 * import com.pulumi.digitalocean.inputs.LoadBalancerHealthcheckArgs;
 * 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 Droplet("web", DropletArgs.builder()
 *             .name("web-1")
 *             .size("s-1vcpu-1gb")
 *             .image("ubuntu-18-04-x64")
 *             .region("nyc3")
 *             .build());
 *         var public_ = new LoadBalancer("public", LoadBalancerArgs.builder()
 *             .name("loadbalancer-1")
 *             .region("nyc3")
 *             .forwardingRules(LoadBalancerForwardingRuleArgs.builder()
 *                 .entryPort(80)
 *                 .entryProtocol("http")
 *                 .targetPort(80)
 *                 .targetProtocol("http")
 *                 .build())
 *             .healthcheck(LoadBalancerHealthcheckArgs.builder()
 *                 .port(22)
 *                 .protocol("tcp")
 *                 .build())
 *             .dropletIds(web.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   web:
 *     type: digitalocean:Droplet
 *     properties:
 *       name: web-1
 *       size: s-1vcpu-1gb
 *       image: ubuntu-18-04-x64
 *       region: nyc3
 *   public:
 *     type: digitalocean:LoadBalancer
 *     properties:
 *       name: loadbalancer-1
 *       region: nyc3
 *       forwardingRules:
 *         - entryPort: 80
 *           entryProtocol: http
 *           targetPort: 80
 *           targetProtocol: http
 *       healthcheck:
 *         port: 22
 *         protocol: tcp
 *       dropletIds:
 *         - ${web.id}
 * ```
 * 
 * When managing certificates attached to the load balancer, make sure to add the `create_before_destroy`
 * lifecycle property in order to ensure the certificate is correctly updated when changed. The order of
 * operations will then be: `Create new certificate` > `Update loadbalancer with new certificate` ->
 * `Delete old certificate`. When doing so, you must also change the name of the certificate,
 * as there cannot be multiple certificates with the same name in an account.
 * ## Import
 * Load Balancers can be imported using the `id`, e.g.
 * ```sh
 * $ pulumi import digitalocean:index/loadBalancer:LoadBalancer myloadbalancer 4de7ac8b-495b-4884-9a69-1050c6793cd6
 * ```
 * @property algorithm **Deprecated** This field has been deprecated. You can no longer specify an algorithm for load balancers.
 * or `least_connections`. The default value is `round_robin`.
 * @property disableLetsEncryptDnsRecords A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. Default value is `false`.
 * @property domains A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
 * **NOTE**: this is a closed beta feature and not available for public use.
 * @property dropletIds A list of the IDs of each droplet to be attached to the Load Balancer.
 * @property dropletTag The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
 * @property enableBackendKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is `false`.
 * @property enableProxyProtocol A boolean value indicating whether PROXY
 * Protocol should be used to pass information from connecting client requests to
 * the backend service. Default value is `false`.
 * @property firewall A block containing rules for allowing/denying traffic to the Load Balancer. The `firewall` block is documented below. Only 1 firewall is allowed.
 * @property forwardingRules A list of `forwarding_rule` to be assigned to the
 * Load Balancer. The `forwarding_rule` block is documented below.
 * @property glbSettings A block containing `glb_settings` required to define target rules for a Global Load Balancer. The `glb_settings` block is documented below.
 * **NOTE**: this is a closed beta feature and not available for public use.
 * @property healthcheck A `healthcheck` block to be assigned to the
 * Load Balancer. The `healthcheck` block is documented below. Only 1 healthcheck is allowed.
 * @property httpIdleTimeoutSeconds Specifies the idle timeout for HTTPS connections on the load balancer in seconds.
 * @property name The Load Balancer name
 * @property network The type of network the Load Balancer is accessible from. It must be either of `INTERNAL` or `EXTERNAL`. Defaults to `EXTERNAL`.
 * **NOTE**: non-`EXTERNAL` type may be part of closed beta feature and not available for public use.
 * @property projectId The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project.
 * @property redirectHttpToHttps A boolean value indicating whether
 * HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443.
 * Default value is `false`.
 * @property region The region to start in
 * @property size The size of the Load Balancer. It must be either `lb-small`, `lb-medium`, or `lb-large`. Defaults to `lb-small`. Only one of `size` or `size_unit` may be provided.
 * @property sizeUnit The size of the Load Balancer. It must be in the range (1, 100). Defaults to `1`. Only one of `size` or `size_unit` may be provided.
 * @property stickySessions A `sticky_sessions` block to be assigned to the
 * Load Balancer. The `sticky_sessions` block is documented below. Only 1 sticky_sessions block is allowed.
 * @property targetLoadBalancerIds A list of Load Balancer IDs to be attached behind a Global Load Balancer.
 * **NOTE**: this is a closed beta feature and not available for public use.
 * @property type The type of the Load Balancer. It must be either of `REGIONAL` or `GLOBAL`. Defaults to `REGIONAL`.
 * **NOTE**: non-`REGIONAL` type may be part of closed beta feature and not available for public use.
 * @property vpcUuid The ID of the VPC where the load balancer will be located.
 */
public data class LoadBalancerArgs(
    @Deprecated(
        message = """
  This field has been deprecated. You can no longer specify an algorithm for load balancers.
  """,
    )
    public val algorithm: Output>? = null,
    public val disableLetsEncryptDnsRecords: Output? = null,
    public val domains: Output>? = null,
    public val dropletIds: Output>? = null,
    public val dropletTag: Output? = null,
    public val enableBackendKeepalive: Output? = null,
    public val enableProxyProtocol: Output? = null,
    public val firewall: Output? = null,
    public val forwardingRules: Output>? = null,
    public val glbSettings: Output? = null,
    public val healthcheck: Output? = null,
    public val httpIdleTimeoutSeconds: Output? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val projectId: Output? = null,
    public val redirectHttpToHttps: Output? = null,
    public val region: Output>? = null,
    public val size: Output? = null,
    public val sizeUnit: Output? = null,
    public val stickySessions: Output? = null,
    public val targetLoadBalancerIds: Output>? = null,
    public val type: Output? = null,
    public val vpcUuid: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.LoadBalancerArgs =
        com.pulumi.digitalocean.LoadBalancerArgs.builder()
            .algorithm(
                algorithm?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .disableLetsEncryptDnsRecords(disableLetsEncryptDnsRecords?.applyValue({ args0 -> args0 }))
            .domains(
                domains?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .dropletIds(dropletIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .dropletTag(dropletTag?.applyValue({ args0 -> args0 }))
            .enableBackendKeepalive(enableBackendKeepalive?.applyValue({ args0 -> args0 }))
            .enableProxyProtocol(enableProxyProtocol?.applyValue({ args0 -> args0 }))
            .firewall(firewall?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .forwardingRules(
                forwardingRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .glbSettings(glbSettings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .healthcheck(healthcheck?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .httpIdleTimeoutSeconds(httpIdleTimeoutSeconds?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0 }))
            .projectId(projectId?.applyValue({ args0 -> args0 }))
            .redirectHttpToHttps(redirectHttpToHttps?.applyValue({ args0 -> args0 }))
            .region(
                region?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .size(size?.applyValue({ args0 -> args0 }))
            .sizeUnit(sizeUnit?.applyValue({ args0 -> args0 }))
            .stickySessions(stickySessions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .targetLoadBalancerIds(targetLoadBalancerIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .type(type?.applyValue({ args0 -> args0 }))
            .vpcUuid(vpcUuid?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LoadBalancerArgs].
 */
@PulumiTagMarker
public class LoadBalancerArgsBuilder internal constructor() {
    private var algorithm: Output>? = null

    private var disableLetsEncryptDnsRecords: Output? = null

    private var domains: Output>? = null

    private var dropletIds: Output>? = null

    private var dropletTag: Output? = null

    private var enableBackendKeepalive: Output? = null

    private var enableProxyProtocol: Output? = null

    private var firewall: Output? = null

    private var forwardingRules: Output>? = null

    private var glbSettings: Output? = null

    private var healthcheck: Output? = null

    private var httpIdleTimeoutSeconds: Output? = null

    private var name: Output? = null

    private var network: Output? = null

    private var projectId: Output? = null

    private var redirectHttpToHttps: Output? = null

    private var region: Output>? = null

    private var size: Output? = null

    private var sizeUnit: Output? = null

    private var stickySessions: Output? = null

    private var targetLoadBalancerIds: Output>? = null

    private var type: Output? = null

    private var vpcUuid: Output? = null

    /**
     * @param value **Deprecated** This field has been deprecated. You can no longer specify an algorithm for load balancers.
     * or `least_connections`. The default value is `round_robin`.
     */
    @Deprecated(
        message = """
  This field has been deprecated. You can no longer specify an algorithm for load balancers.
  """,
    )
    @JvmName("kdsyfurjedilbqkq")
    public suspend fun algorithm(`value`: Output>) {
        this.algorithm = value
    }

    /**
     * @param value A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. Default value is `false`.
     */
    @JvmName("ukpvilvcufusypkj")
    public suspend fun disableLetsEncryptDnsRecords(`value`: Output) {
        this.disableLetsEncryptDnsRecords = value
    }

    /**
     * @param value A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("jqsuqbkdidcacavh")
    public suspend fun domains(`value`: Output>) {
        this.domains = value
    }

    @JvmName("bosfheqqjdjaguoo")
    public suspend fun domains(vararg values: Output) {
        this.domains = Output.all(values.asList())
    }

    /**
     * @param values A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("tvjtygnhqusrsfjc")
    public suspend fun domains(values: List>) {
        this.domains = Output.all(values)
    }

    /**
     * @param value A list of the IDs of each droplet to be attached to the Load Balancer.
     */
    @JvmName("ikcvonuxvhsceexr")
    public suspend fun dropletIds(`value`: Output>) {
        this.dropletIds = value
    }

    @JvmName("uwvvavugyjqfrafs")
    public suspend fun dropletIds(vararg values: Output) {
        this.dropletIds = Output.all(values.asList())
    }

    /**
     * @param values A list of the IDs of each droplet to be attached to the Load Balancer.
     */
    @JvmName("ebuudascnprppefe")
    public suspend fun dropletIds(values: List>) {
        this.dropletIds = Output.all(values)
    }

    /**
     * @param value The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
     */
    @JvmName("tklxgkfaatlkmrfq")
    public suspend fun dropletTag(`value`: Output) {
        this.dropletTag = value
    }

    /**
     * @param value A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is `false`.
     */
    @JvmName("qjglsywdsibhphnm")
    public suspend fun enableBackendKeepalive(`value`: Output) {
        this.enableBackendKeepalive = value
    }

    /**
     * @param value A boolean value indicating whether PROXY
     * Protocol should be used to pass information from connecting client requests to
     * the backend service. Default value is `false`.
     */
    @JvmName("jyynkrwsxiapqeif")
    public suspend fun enableProxyProtocol(`value`: Output) {
        this.enableProxyProtocol = value
    }

    /**
     * @param value A block containing rules for allowing/denying traffic to the Load Balancer. The `firewall` block is documented below. Only 1 firewall is allowed.
     */
    @JvmName("npdajoikeoycqsri")
    public suspend fun firewall(`value`: Output) {
        this.firewall = value
    }

    /**
     * @param value A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("akhtvwxcfvhlassm")
    public suspend fun forwardingRules(`value`: Output>) {
        this.forwardingRules = value
    }

    @JvmName("dwpwbnyrloxesusm")
    public suspend fun forwardingRules(vararg values: Output) {
        this.forwardingRules = Output.all(values.asList())
    }

    /**
     * @param values A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("bblikafefsmkuqjt")
    public suspend fun forwardingRules(values: List>) {
        this.forwardingRules = Output.all(values)
    }

    /**
     * @param value A block containing `glb_settings` required to define target rules for a Global Load Balancer. The `glb_settings` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("xrdiaaerfeauvlbp")
    public suspend fun glbSettings(`value`: Output) {
        this.glbSettings = value
    }

    /**
     * @param value A `healthcheck` block to be assigned to the
     * Load Balancer. The `healthcheck` block is documented below. Only 1 healthcheck is allowed.
     */
    @JvmName("chgdsdaepfulsvhl")
    public suspend fun healthcheck(`value`: Output) {
        this.healthcheck = value
    }

    /**
     * @param value Specifies the idle timeout for HTTPS connections on the load balancer in seconds.
     */
    @JvmName("fopwxxjfdgfxcafk")
    public suspend fun httpIdleTimeoutSeconds(`value`: Output) {
        this.httpIdleTimeoutSeconds = value
    }

    /**
     * @param value The Load Balancer name
     */
    @JvmName("xnyohnlydhdauteq")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The type of network the Load Balancer is accessible from. It must be either of `INTERNAL` or `EXTERNAL`. Defaults to `EXTERNAL`.
     * **NOTE**: non-`EXTERNAL` type may be part of closed beta feature and not available for public use.
     */
    @JvmName("nrfcnhmgipriqqyi")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project.
     */
    @JvmName("cobhmepgfutekfcn")
    public suspend fun projectId(`value`: Output) {
        this.projectId = value
    }

    /**
     * @param value A boolean value indicating whether
     * HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443.
     * Default value is `false`.
     */
    @JvmName("odmkgekwaboyntxu")
    public suspend fun redirectHttpToHttps(`value`: Output) {
        this.redirectHttpToHttps = value
    }

    /**
     * @param value The region to start in
     */
    @JvmName("gkbodryyhcqerook")
    public suspend fun region(`value`: Output>) {
        this.region = value
    }

    /**
     * @param value The size of the Load Balancer. It must be either `lb-small`, `lb-medium`, or `lb-large`. Defaults to `lb-small`. Only one of `size` or `size_unit` may be provided.
     */
    @JvmName("vadnavykisqalwln")
    public suspend fun size(`value`: Output) {
        this.size = value
    }

    /**
     * @param value The size of the Load Balancer. It must be in the range (1, 100). Defaults to `1`. Only one of `size` or `size_unit` may be provided.
     */
    @JvmName("whkjoblrwlpcsxxq")
    public suspend fun sizeUnit(`value`: Output) {
        this.sizeUnit = value
    }

    /**
     * @param value A `sticky_sessions` block to be assigned to the
     * Load Balancer. The `sticky_sessions` block is documented below. Only 1 sticky_sessions block is allowed.
     */
    @JvmName("akvwlehqdqnabxrj")
    public suspend fun stickySessions(`value`: Output) {
        this.stickySessions = value
    }

    /**
     * @param value A list of Load Balancer IDs to be attached behind a Global Load Balancer.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("chevpykybcafcvwl")
    public suspend fun targetLoadBalancerIds(`value`: Output>) {
        this.targetLoadBalancerIds = value
    }

    @JvmName("eclgkhxvjhnaubou")
    public suspend fun targetLoadBalancerIds(vararg values: Output) {
        this.targetLoadBalancerIds = Output.all(values.asList())
    }

    /**
     * @param values A list of Load Balancer IDs to be attached behind a Global Load Balancer.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("jxvpjyvxxqllooig")
    public suspend fun targetLoadBalancerIds(values: List>) {
        this.targetLoadBalancerIds = Output.all(values)
    }

    /**
     * @param value The type of the Load Balancer. It must be either of `REGIONAL` or `GLOBAL`. Defaults to `REGIONAL`.
     * **NOTE**: non-`REGIONAL` type may be part of closed beta feature and not available for public use.
     */
    @JvmName("rgpbcmlvohpkevpt")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The ID of the VPC where the load balancer will be located.
     */
    @JvmName("beefyuaobtphnvku")
    public suspend fun vpcUuid(`value`: Output) {
        this.vpcUuid = value
    }

    /**
     * @param value **Deprecated** This field has been deprecated. You can no longer specify an algorithm for load balancers.
     * or `least_connections`. The default value is `round_robin`.
     */
    @Deprecated(
        message = """
  This field has been deprecated. You can no longer specify an algorithm for load balancers.
  """,
    )
    @JvmName("bfogxvdmdhwysflu")
    public suspend fun algorithm(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.algorithm = mapped
    }

    /**
     * @param value **Deprecated** This field has been deprecated. You can no longer specify an algorithm for load balancers.
     * or `least_connections`. The default value is `round_robin`.
     */
    @Deprecated(
        message = """
  This field has been deprecated. You can no longer specify an algorithm for load balancers.
  """,
    )
    @JvmName("jkbfrhsjjrtjkxid")
    public fun algorithm(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.algorithm = mapped
    }

    /**
     * @param value **Deprecated** This field has been deprecated. You can no longer specify an algorithm for load balancers.
     * or `least_connections`. The default value is `round_robin`.
     */
    @Deprecated(
        message = """
  This field has been deprecated. You can no longer specify an algorithm for load balancers.
  """,
    )
    @JvmName("xujtpxyellohhydn")
    public fun algorithm(`value`: Algorithm) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.algorithm = mapped
    }

    /**
     * @param value A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. Default value is `false`.
     */
    @JvmName("mbobrmogsnqvsgll")
    public suspend fun disableLetsEncryptDnsRecords(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableLetsEncryptDnsRecords = mapped
    }

    /**
     * @param value A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("oxuchahqyeednarb")
    public suspend fun domains(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.domains = mapped
    }

    /**
     * @param argument A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("lejeihhkfbuwamog")
    public suspend fun domains(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerDomainArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.domains = mapped
    }

    /**
     * @param argument A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("vkdkoskrcboldwsd")
    public suspend fun domains(vararg argument: suspend LoadBalancerDomainArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerDomainArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.domains = mapped
    }

    /**
     * @param argument A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("rlexaiovamlucgdp")
    public suspend fun domains(argument: suspend LoadBalancerDomainArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(LoadBalancerDomainArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.domains = mapped
    }

    /**
     * @param values A list of `domains` required to ingress traffic to a Global Load Balancer. The `domains` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("bcircgmfbiprewah")
    public suspend fun domains(vararg values: LoadBalancerDomainArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.domains = mapped
    }

    /**
     * @param value A list of the IDs of each droplet to be attached to the Load Balancer.
     */
    @JvmName("penigtnkegdhdqpq")
    public suspend fun dropletIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dropletIds = mapped
    }

    /**
     * @param values A list of the IDs of each droplet to be attached to the Load Balancer.
     */
    @JvmName("eroctbpulcesgcek")
    public suspend fun dropletIds(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dropletIds = mapped
    }

    /**
     * @param value The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
     */
    @JvmName("koinusuexmojmcvg")
    public suspend fun dropletTag(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dropletTag = mapped
    }

    /**
     * @param value A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is `false`.
     */
    @JvmName("xbcohvuikhtkbxmu")
    public suspend fun enableBackendKeepalive(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableBackendKeepalive = mapped
    }

    /**
     * @param value A boolean value indicating whether PROXY
     * Protocol should be used to pass information from connecting client requests to
     * the backend service. Default value is `false`.
     */
    @JvmName("qvaodkscojwtnloo")
    public suspend fun enableProxyProtocol(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableProxyProtocol = mapped
    }

    /**
     * @param value A block containing rules for allowing/denying traffic to the Load Balancer. The `firewall` block is documented below. Only 1 firewall is allowed.
     */
    @JvmName("salsivexxvuxoqrb")
    public suspend fun firewall(`value`: LoadBalancerFirewallArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.firewall = mapped
    }

    /**
     * @param argument A block containing rules for allowing/denying traffic to the Load Balancer. The `firewall` block is documented below. Only 1 firewall is allowed.
     */
    @JvmName("fsyolnyvwlkhrdll")
    public suspend fun firewall(argument: suspend LoadBalancerFirewallArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancerFirewallArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.firewall = mapped
    }

    /**
     * @param value A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("kniycqacsxluhkay")
    public suspend fun forwardingRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forwardingRules = mapped
    }

    /**
     * @param argument A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("ektcokedplxkdoct")
    public suspend fun forwardingRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerForwardingRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.forwardingRules = mapped
    }

    /**
     * @param argument A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("omrhpoautlhhvrun")
    public suspend fun forwardingRules(vararg argument: suspend LoadBalancerForwardingRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerForwardingRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.forwardingRules = mapped
    }

    /**
     * @param argument A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("bgqnxqtpgmqymgpr")
    public suspend fun forwardingRules(argument: suspend LoadBalancerForwardingRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerForwardingRuleArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.forwardingRules = mapped
    }

    /**
     * @param values A list of `forwarding_rule` to be assigned to the
     * Load Balancer. The `forwarding_rule` block is documented below.
     */
    @JvmName("rogomuxtvhemraep")
    public suspend fun forwardingRules(vararg values: LoadBalancerForwardingRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.forwardingRules = mapped
    }

    /**
     * @param value A block containing `glb_settings` required to define target rules for a Global Load Balancer. The `glb_settings` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("ppjuwpqkqmgguqfc")
    public suspend fun glbSettings(`value`: LoadBalancerGlbSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.glbSettings = mapped
    }

    /**
     * @param argument A block containing `glb_settings` required to define target rules for a Global Load Balancer. The `glb_settings` block is documented below.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("peggjgtluxsvqdvn")
    public suspend fun glbSettings(argument: suspend LoadBalancerGlbSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancerGlbSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.glbSettings = mapped
    }

    /**
     * @param value A `healthcheck` block to be assigned to the
     * Load Balancer. The `healthcheck` block is documented below. Only 1 healthcheck is allowed.
     */
    @JvmName("poicadhehqkmysnr")
    public suspend fun healthcheck(`value`: LoadBalancerHealthcheckArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthcheck = mapped
    }

    /**
     * @param argument A `healthcheck` block to be assigned to the
     * Load Balancer. The `healthcheck` block is documented below. Only 1 healthcheck is allowed.
     */
    @JvmName("rxfaplegeahhibkb")
    public suspend fun healthcheck(argument: suspend LoadBalancerHealthcheckArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancerHealthcheckArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.healthcheck = mapped
    }

    /**
     * @param value Specifies the idle timeout for HTTPS connections on the load balancer in seconds.
     */
    @JvmName("wghddlolthaipeqm")
    public suspend fun httpIdleTimeoutSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpIdleTimeoutSeconds = mapped
    }

    /**
     * @param value The Load Balancer name
     */
    @JvmName("pgsubtgpkgxhhclc")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The type of network the Load Balancer is accessible from. It must be either of `INTERNAL` or `EXTERNAL`. Defaults to `EXTERNAL`.
     * **NOTE**: non-`EXTERNAL` type may be part of closed beta feature and not available for public use.
     */
    @JvmName("lssqbpcgkmxuuwxr")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param value The ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project.
     */
    @JvmName("vutjswnlgqmyjmso")
    public suspend fun projectId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.projectId = mapped
    }

    /**
     * @param value A boolean value indicating whether
     * HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443.
     * Default value is `false`.
     */
    @JvmName("rjbqobdxrltahpwq")
    public suspend fun redirectHttpToHttps(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.redirectHttpToHttps = mapped
    }

    /**
     * @param value The region to start in
     */
    @JvmName("mparthvsefsuniee")
    public suspend fun region(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The region to start in
     */
    @JvmName("amkwwfwbuvebupen")
    public fun region(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The region to start in
     */
    @JvmName("dyjejpjbwmajaiib")
    public fun region(`value`: Region) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The size of the Load Balancer. It must be either `lb-small`, `lb-medium`, or `lb-large`. Defaults to `lb-small`. Only one of `size` or `size_unit` may be provided.
     */
    @JvmName("qoxjuoqlvkcwyxpy")
    public suspend fun size(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.size = mapped
    }

    /**
     * @param value The size of the Load Balancer. It must be in the range (1, 100). Defaults to `1`. Only one of `size` or `size_unit` may be provided.
     */
    @JvmName("aufsovijyasjdpbr")
    public suspend fun sizeUnit(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sizeUnit = mapped
    }

    /**
     * @param value A `sticky_sessions` block to be assigned to the
     * Load Balancer. The `sticky_sessions` block is documented below. Only 1 sticky_sessions block is allowed.
     */
    @JvmName("jhrmmxsxmpyuapwc")
    public suspend fun stickySessions(`value`: LoadBalancerStickySessionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stickySessions = mapped
    }

    /**
     * @param argument A `sticky_sessions` block to be assigned to the
     * Load Balancer. The `sticky_sessions` block is documented below. Only 1 sticky_sessions block is allowed.
     */
    @JvmName("jecmpepneqxglnee")
    public suspend fun stickySessions(argument: suspend LoadBalancerStickySessionsArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancerStickySessionsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.stickySessions = mapped
    }

    /**
     * @param value A list of Load Balancer IDs to be attached behind a Global Load Balancer.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("wjwenorluuwyyqpf")
    public suspend fun targetLoadBalancerIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetLoadBalancerIds = mapped
    }

    /**
     * @param values A list of Load Balancer IDs to be attached behind a Global Load Balancer.
     * **NOTE**: this is a closed beta feature and not available for public use.
     */
    @JvmName("vndwocyvxvxyvuxh")
    public suspend fun targetLoadBalancerIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetLoadBalancerIds = mapped
    }

    /**
     * @param value The type of the Load Balancer. It must be either of `REGIONAL` or `GLOBAL`. Defaults to `REGIONAL`.
     * **NOTE**: non-`REGIONAL` type may be part of closed beta feature and not available for public use.
     */
    @JvmName("apbsforwajgqefrn")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value The ID of the VPC where the load balancer will be located.
     */
    @JvmName("rgjpjbttvikxnqjs")
    public suspend fun vpcUuid(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcUuid = mapped
    }

    internal fun build(): LoadBalancerArgs = LoadBalancerArgs(
        algorithm = algorithm,
        disableLetsEncryptDnsRecords = disableLetsEncryptDnsRecords,
        domains = domains,
        dropletIds = dropletIds,
        dropletTag = dropletTag,
        enableBackendKeepalive = enableBackendKeepalive,
        enableProxyProtocol = enableProxyProtocol,
        firewall = firewall,
        forwardingRules = forwardingRules,
        glbSettings = glbSettings,
        healthcheck = healthcheck,
        httpIdleTimeoutSeconds = httpIdleTimeoutSeconds,
        name = name,
        network = network,
        projectId = projectId,
        redirectHttpToHttps = redirectHttpToHttps,
        region = region,
        size = size,
        sizeUnit = sizeUnit,
        stickySessions = stickySessions,
        targetLoadBalancerIds = targetLoadBalancerIds,
        type = type,
        vpcUuid = vpcUuid,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy