Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@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