com.pulumi.cloudflare.kotlin.LoadBalancerPoolArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.LoadBalancerPoolArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolLoadSheddingArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolLoadSheddingArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolOriginArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolOriginArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolOriginSteeringArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPoolOriginSteeringArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a Cloudflare Load Balancer pool resource. This provides a
* pool of origins that can be used by a Cloudflare Load Balancer.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const example = new cloudflare.LoadBalancerPool("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "example-pool",
* origins: [
* {
* name: "example-1",
* address: "192.0.2.1",
* enabled: false,
* headers: [{
* header: "Host",
* values: ["example-1"],
* }],
* },
* {
* name: "example-2",
* address: "192.0.2.2",
* headers: [{
* header: "Host",
* values: ["example-2"],
* }],
* },
* ],
* latitude: 55,
* longitude: -12,
* description: "example load balancer pool",
* enabled: false,
* minimumOrigins: 1,
* notificationEmail: "[email protected]",
* loadSheddings: [{
* defaultPercent: 55,
* defaultPolicy: "random",
* sessionPercent: 12,
* sessionPolicy: "hash",
* }],
* originSteerings: [{
* policy: "random",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* example = cloudflare.LoadBalancerPool("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="example-pool",
* origins=[
* {
* "name": "example-1",
* "address": "192.0.2.1",
* "enabled": False,
* "headers": [{
* "header": "Host",
* "values": ["example-1"],
* }],
* },
* {
* "name": "example-2",
* "address": "192.0.2.2",
* "headers": [{
* "header": "Host",
* "values": ["example-2"],
* }],
* },
* ],
* latitude=55,
* longitude=-12,
* description="example load balancer pool",
* enabled=False,
* minimum_origins=1,
* notification_email="[email protected]",
* load_sheddings=[{
* "default_percent": 55,
* "default_policy": "random",
* "session_percent": 12,
* "session_policy": "hash",
* }],
* origin_steerings=[{
* "policy": "random",
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var example = new Cloudflare.LoadBalancerPool("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "example-pool",
* Origins = new[]
* {
* new Cloudflare.Inputs.LoadBalancerPoolOriginArgs
* {
* Name = "example-1",
* Address = "192.0.2.1",
* Enabled = false,
* Headers = new[]
* {
* new Cloudflare.Inputs.LoadBalancerPoolOriginHeaderArgs
* {
* Header = "Host",
* Values = new[]
* {
* "example-1",
* },
* },
* },
* },
* new Cloudflare.Inputs.LoadBalancerPoolOriginArgs
* {
* Name = "example-2",
* Address = "192.0.2.2",
* Headers = new[]
* {
* new Cloudflare.Inputs.LoadBalancerPoolOriginHeaderArgs
* {
* Header = "Host",
* Values = new[]
* {
* "example-2",
* },
* },
* },
* },
* },
* Latitude = 55,
* Longitude = -12,
* Description = "example load balancer pool",
* Enabled = false,
* MinimumOrigins = 1,
* NotificationEmail = "[email protected]",
* LoadSheddings = new[]
* {
* new Cloudflare.Inputs.LoadBalancerPoolLoadSheddingArgs
* {
* DefaultPercent = 55,
* DefaultPolicy = "random",
* SessionPercent = 12,
* SessionPolicy = "hash",
* },
* },
* OriginSteerings = new[]
* {
* new Cloudflare.Inputs.LoadBalancerPoolOriginSteeringArgs
* {
* Policy = "random",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudflare.NewLoadBalancerPool(ctx, "example", &cloudflare.LoadBalancerPoolArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("example-pool"),
* Origins: cloudflare.LoadBalancerPoolOriginArray{
* &cloudflare.LoadBalancerPoolOriginArgs{
* Name: pulumi.String("example-1"),
* Address: pulumi.String("192.0.2.1"),
* Enabled: pulumi.Bool(false),
* Headers: cloudflare.LoadBalancerPoolOriginHeaderArray{
* &cloudflare.LoadBalancerPoolOriginHeaderArgs{
* Header: pulumi.String("Host"),
* Values: pulumi.StringArray{
* pulumi.String("example-1"),
* },
* },
* },
* },
* &cloudflare.LoadBalancerPoolOriginArgs{
* Name: pulumi.String("example-2"),
* Address: pulumi.String("192.0.2.2"),
* Headers: cloudflare.LoadBalancerPoolOriginHeaderArray{
* &cloudflare.LoadBalancerPoolOriginHeaderArgs{
* Header: pulumi.String("Host"),
* Values: pulumi.StringArray{
* pulumi.String("example-2"),
* },
* },
* },
* },
* },
* Latitude: pulumi.Float64(55),
* Longitude: -12,
* Description: pulumi.String("example load balancer pool"),
* Enabled: pulumi.Bool(false),
* MinimumOrigins: pulumi.Int(1),
* NotificationEmail: pulumi.String("[email protected]"),
* LoadSheddings: cloudflare.LoadBalancerPoolLoadSheddingArray{
* &cloudflare.LoadBalancerPoolLoadSheddingArgs{
* DefaultPercent: pulumi.Float64(55),
* DefaultPolicy: pulumi.String("random"),
* SessionPercent: pulumi.Float64(12),
* SessionPolicy: pulumi.String("hash"),
* },
* },
* OriginSteerings: cloudflare.LoadBalancerPoolOriginSteeringArray{
* &cloudflare.LoadBalancerPoolOriginSteeringArgs{
* Policy: pulumi.String("random"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:LoadBalancerPool
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: example-pool
* origins:
* - name: example-1
* address: 192.0.2.1
* enabled: false
* headers:
* - header: Host
* values:
* - example-1
* - name: example-2
* address: 192.0.2.2
* headers:
* - header: Host
* values:
* - example-2
* latitude: 55
* longitude: -12
* description: example load balancer pool
* enabled: false
* minimumOrigins: 1
* notificationEmail: [email protected]
* loadSheddings:
* - defaultPercent: 55
* defaultPolicy: random
* sessionPercent: 12
* sessionPolicy: hash
* originSteerings:
* - policy: random
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/loadBalancerPool:LoadBalancerPool example /
* ```
* @property accountId The account identifier to target for the resource.
* @property checkRegions A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://developers.cloudflare.com/load-balancing/reference/region-mapping-api).
* @property description Free text description.
* @property enabled Whether to enable (the default) this pool. Disabled pools will not receive traffic and are excluded from health checks. Disabling a pool will cause any load balancers using it to failover to the next pool (if any). Defaults to `true`.
* @property latitude The latitude this pool is physically located at; used for proximity steering.
* @property loadSheddings Setting for controlling load shedding for this pool.
* @property longitude The longitude this pool is physically located at; used for proximity steering.
* @property minimumOrigins The minimum number of origins that must be healthy for this pool to serve traffic. If the number of healthy origins falls below this number, the pool will be marked unhealthy and we will failover to the next available pool. Defaults to `1`.
* @property monitor The ID of the Monitor to use for health checking origins within this pool.
* @property name A short name (tag) for the pool.
* @property notificationEmail The email address to send health status notifications to. This can be an individual mailbox or a mailing list. Multiple emails can be supplied as a comma delimited list.
* @property originSteerings Set an origin steering policy to control origin selection within a pool.
* @property origins The list of origins within this pool. Traffic directed at this pool is balanced across all currently healthy origins, provided the pool itself is healthy.
*/
public data class LoadBalancerPoolArgs(
public val accountId: Output? = null,
public val checkRegions: Output>? = null,
public val description: Output? = null,
public val enabled: Output? = null,
public val latitude: Output? = null,
public val loadSheddings: Output>? = null,
public val longitude: Output? = null,
public val minimumOrigins: Output? = null,
public val monitor: Output? = null,
public val name: Output? = null,
public val notificationEmail: Output? = null,
public val originSteerings: Output>? = null,
public val origins: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.LoadBalancerPoolArgs =
com.pulumi.cloudflare.LoadBalancerPoolArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.checkRegions(checkRegions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.description(description?.applyValue({ args0 -> args0 }))
.enabled(enabled?.applyValue({ args0 -> args0 }))
.latitude(latitude?.applyValue({ args0 -> args0 }))
.loadSheddings(
loadSheddings?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.longitude(longitude?.applyValue({ args0 -> args0 }))
.minimumOrigins(minimumOrigins?.applyValue({ args0 -> args0 }))
.monitor(monitor?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.notificationEmail(notificationEmail?.applyValue({ args0 -> args0 }))
.originSteerings(
originSteerings?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.origins(
origins?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [LoadBalancerPoolArgs].
*/
@PulumiTagMarker
public class LoadBalancerPoolArgsBuilder internal constructor() {
private var accountId: Output? = null
private var checkRegions: Output>? = null
private var description: Output? = null
private var enabled: Output? = null
private var latitude: Output? = null
private var loadSheddings: Output>? = null
private var longitude: Output? = null
private var minimumOrigins: Output? = null
private var monitor: Output? = null
private var name: Output? = null
private var notificationEmail: Output? = null
private var originSteerings: Output>? = null
private var origins: Output>? = null
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("ikmcxqraxavekryc")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://developers.cloudflare.com/load-balancing/reference/region-mapping-api).
*/
@JvmName("uwyrfvwbqsrkmhkk")
public suspend fun checkRegions(`value`: Output>) {
this.checkRegions = value
}
@JvmName("ubiqxkacuhfpatxp")
public suspend fun checkRegions(vararg values: Output) {
this.checkRegions = Output.all(values.asList())
}
/**
* @param values A list of regions (specified by region code) from which to run health checks. Empty means every Cloudflare data center (the default), but requires an Enterprise plan. Region codes can be found [here](https://developers.cloudflare.com/load-balancing/reference/region-mapping-api).
*/
@JvmName("igyntymoojoflygu")
public suspend fun checkRegions(values: List