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

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

Go to download

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.LoadBalancerArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerAdaptiveRoutingArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerAdaptiveRoutingArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerCountryPoolArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerCountryPoolArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerLocationStrategyArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerLocationStrategyArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPopPoolArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerPopPoolArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRandomSteeringArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRandomSteeringArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRegionPoolArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRegionPoolArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRuleArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerRuleArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerSessionAffinityAttributeArgs
import com.pulumi.cloudflare.kotlin.inputs.LoadBalancerSessionAffinityAttributeArgsBuilder
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare Load Balancer resource. This sits in front of
 * a number of defined pools of origins and provides various options
 * for geographically-aware load balancing. Note that the load balancing
 * feature must be enabled in your Cloudflare account before you can use
 * this resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const exampleLoadBalancerPool = new cloudflare.LoadBalancerPool("example", {
 *     name: "example-lb-pool",
 *     origins: [{
 *         name: "example-1",
 *         address: "192.0.2.1",
 *         enabled: false,
 *     }],
 * });
 * // Define a load balancer which always points to a pool we define below.
 * // In normal usage, would have different pools set for different pops
 * // (cloudflare points-of-presence) and/or for different regions.
 * // Within each pop or region we can define multiple pools in failover order.
 * const example = new cloudflare.LoadBalancer("example", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     name: "example-load-balancer.example.com",
 *     fallbackPoolId: exampleLoadBalancerPool.id,
 *     defaultPoolIds: [exampleLoadBalancerPool.id],
 *     description: "example load balancer using geo-balancing",
 *     proxied: true,
 *     steeringPolicy: "geo",
 *     popPools: [{
 *         pop: "LAX",
 *         poolIds: [exampleLoadBalancerPool.id],
 *     }],
 *     countryPools: [{
 *         country: "US",
 *         poolIds: [exampleLoadBalancerPool.id],
 *     }],
 *     regionPools: [{
 *         region: "WNAM",
 *         poolIds: [exampleLoadBalancerPool.id],
 *     }],
 *     rules: [{
 *         name: "example rule",
 *         condition: "http.request.uri.path contains \"testing\"",
 *         fixedResponse: {
 *             messageBody: "hello",
 *             statusCode: 200,
 *             contentType: "html",
 *             location: "www.example.com",
 *         },
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example_load_balancer_pool = cloudflare.LoadBalancerPool("example",
 *     name="example-lb-pool",
 *     origins=[{
 *         "name": "example-1",
 *         "address": "192.0.2.1",
 *         "enabled": False,
 *     }])
 * # Define a load balancer which always points to a pool we define below.
 * # In normal usage, would have different pools set for different pops
 * # (cloudflare points-of-presence) and/or for different regions.
 * # Within each pop or region we can define multiple pools in failover order.
 * example = cloudflare.LoadBalancer("example",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     name="example-load-balancer.example.com",
 *     fallback_pool_id=example_load_balancer_pool.id,
 *     default_pool_ids=[example_load_balancer_pool.id],
 *     description="example load balancer using geo-balancing",
 *     proxied=True,
 *     steering_policy="geo",
 *     pop_pools=[{
 *         "pop": "LAX",
 *         "pool_ids": [example_load_balancer_pool.id],
 *     }],
 *     country_pools=[{
 *         "country": "US",
 *         "pool_ids": [example_load_balancer_pool.id],
 *     }],
 *     region_pools=[{
 *         "region": "WNAM",
 *         "pool_ids": [example_load_balancer_pool.id],
 *     }],
 *     rules=[{
 *         "name": "example rule",
 *         "condition": "http.request.uri.path contains \"testing\"",
 *         "fixed_response": {
 *             "message_body": "hello",
 *             "status_code": 200,
 *             "content_type": "html",
 *             "location": "www.example.com",
 *         },
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var exampleLoadBalancerPool = new Cloudflare.LoadBalancerPool("example", new()
 *     {
 *         Name = "example-lb-pool",
 *         Origins = new[]
 *         {
 *             new Cloudflare.Inputs.LoadBalancerPoolOriginArgs
 *             {
 *                 Name = "example-1",
 *                 Address = "192.0.2.1",
 *                 Enabled = false,
 *             },
 *         },
 *     });
 *     // Define a load balancer which always points to a pool we define below.
 *     // In normal usage, would have different pools set for different pops
 *     // (cloudflare points-of-presence) and/or for different regions.
 *     // Within each pop or region we can define multiple pools in failover order.
 *     var example = new Cloudflare.LoadBalancer("example", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Name = "example-load-balancer.example.com",
 *         FallbackPoolId = exampleLoadBalancerPool.Id,
 *         DefaultPoolIds = new[]
 *         {
 *             exampleLoadBalancerPool.Id,
 *         },
 *         Description = "example load balancer using geo-balancing",
 *         Proxied = true,
 *         SteeringPolicy = "geo",
 *         PopPools = new[]
 *         {
 *             new Cloudflare.Inputs.LoadBalancerPopPoolArgs
 *             {
 *                 Pop = "LAX",
 *                 PoolIds = new[]
 *                 {
 *                     exampleLoadBalancerPool.Id,
 *                 },
 *             },
 *         },
 *         CountryPools = new[]
 *         {
 *             new Cloudflare.Inputs.LoadBalancerCountryPoolArgs
 *             {
 *                 Country = "US",
 *                 PoolIds = new[]
 *                 {
 *                     exampleLoadBalancerPool.Id,
 *                 },
 *             },
 *         },
 *         RegionPools = new[]
 *         {
 *             new Cloudflare.Inputs.LoadBalancerRegionPoolArgs
 *             {
 *                 Region = "WNAM",
 *                 PoolIds = new[]
 *                 {
 *                     exampleLoadBalancerPool.Id,
 *                 },
 *             },
 *         },
 *         Rules = new[]
 *         {
 *             new Cloudflare.Inputs.LoadBalancerRuleArgs
 *             {
 *                 Name = "example rule",
 *                 Condition = "http.request.uri.path contains \"testing\"",
 *                 FixedResponse = new Cloudflare.Inputs.LoadBalancerRuleFixedResponseArgs
 *                 {
 *                     MessageBody = "hello",
 *                     StatusCode = 200,
 *                     ContentType = "html",
 *                     Location = "www.example.com",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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 {
 * 		exampleLoadBalancerPool, err := cloudflare.NewLoadBalancerPool(ctx, "example", &cloudflare.LoadBalancerPoolArgs{
 * 			Name: pulumi.String("example-lb-pool"),
 * 			Origins: cloudflare.LoadBalancerPoolOriginArray{
 * 				&cloudflare.LoadBalancerPoolOriginArgs{
 * 					Name:    pulumi.String("example-1"),
 * 					Address: pulumi.String("192.0.2.1"),
 * 					Enabled: pulumi.Bool(false),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Define a load balancer which always points to a pool we define below.
 * 		// In normal usage, would have different pools set for different pops
 * 		// (cloudflare points-of-presence) and/or for different regions.
 * 		// Within each pop or region we can define multiple pools in failover order.
 * 		_, err = cloudflare.NewLoadBalancer(ctx, "example", &cloudflare.LoadBalancerArgs{
 * 			ZoneId:         pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Name:           pulumi.String("example-load-balancer.example.com"),
 * 			FallbackPoolId: exampleLoadBalancerPool.ID(),
 * 			DefaultPoolIds: pulumi.StringArray{
 * 				exampleLoadBalancerPool.ID(),
 * 			},
 * 			Description:    pulumi.String("example load balancer using geo-balancing"),
 * 			Proxied:        pulumi.Bool(true),
 * 			SteeringPolicy: pulumi.String("geo"),
 * 			PopPools: cloudflare.LoadBalancerPopPoolArray{
 * 				&cloudflare.LoadBalancerPopPoolArgs{
 * 					Pop: pulumi.String("LAX"),
 * 					PoolIds: pulumi.StringArray{
 * 						exampleLoadBalancerPool.ID(),
 * 					},
 * 				},
 * 			},
 * 			CountryPools: cloudflare.LoadBalancerCountryPoolArray{
 * 				&cloudflare.LoadBalancerCountryPoolArgs{
 * 					Country: pulumi.String("US"),
 * 					PoolIds: pulumi.StringArray{
 * 						exampleLoadBalancerPool.ID(),
 * 					},
 * 				},
 * 			},
 * 			RegionPools: cloudflare.LoadBalancerRegionPoolArray{
 * 				&cloudflare.LoadBalancerRegionPoolArgs{
 * 					Region: pulumi.String("WNAM"),
 * 					PoolIds: pulumi.StringArray{
 * 						exampleLoadBalancerPool.ID(),
 * 					},
 * 				},
 * 			},
 * 			Rules: cloudflare.LoadBalancerRuleArray{
 * 				&cloudflare.LoadBalancerRuleArgs{
 * 					Name:      pulumi.String("example rule"),
 * 					Condition: pulumi.String("http.request.uri.path contains \"testing\""),
 * 					FixedResponse: &cloudflare.LoadBalancerRuleFixedResponseArgs{
 * 						MessageBody: pulumi.String("hello"),
 * 						StatusCode:  pulumi.Int(200),
 * 						ContentType: pulumi.String("html"),
 * 						Location:    pulumi.String("www.example.com"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.cloudflare.LoadBalancerPool;
 * import com.pulumi.cloudflare.LoadBalancerPoolArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerPoolOriginArgs;
 * import com.pulumi.cloudflare.LoadBalancer;
 * import com.pulumi.cloudflare.LoadBalancerArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerPopPoolArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerCountryPoolArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerRegionPoolArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerRuleArgs;
 * import com.pulumi.cloudflare.inputs.LoadBalancerRuleFixedResponseArgs;
 * 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 exampleLoadBalancerPool = new LoadBalancerPool("exampleLoadBalancerPool", LoadBalancerPoolArgs.builder()
 *             .name("example-lb-pool")
 *             .origins(LoadBalancerPoolOriginArgs.builder()
 *                 .name("example-1")
 *                 .address("192.0.2.1")
 *                 .enabled(false)
 *                 .build())
 *             .build());
 *         // Define a load balancer which always points to a pool we define below.
 *         // In normal usage, would have different pools set for different pops
 *         // (cloudflare points-of-presence) and/or for different regions.
 *         // Within each pop or region we can define multiple pools in failover order.
 *         var example = new LoadBalancer("example", LoadBalancerArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .name("example-load-balancer.example.com")
 *             .fallbackPoolId(exampleLoadBalancerPool.id())
 *             .defaultPoolIds(exampleLoadBalancerPool.id())
 *             .description("example load balancer using geo-balancing")
 *             .proxied(true)
 *             .steeringPolicy("geo")
 *             .popPools(LoadBalancerPopPoolArgs.builder()
 *                 .pop("LAX")
 *                 .poolIds(exampleLoadBalancerPool.id())
 *                 .build())
 *             .countryPools(LoadBalancerCountryPoolArgs.builder()
 *                 .country("US")
 *                 .poolIds(exampleLoadBalancerPool.id())
 *                 .build())
 *             .regionPools(LoadBalancerRegionPoolArgs.builder()
 *                 .region("WNAM")
 *                 .poolIds(exampleLoadBalancerPool.id())
 *                 .build())
 *             .rules(LoadBalancerRuleArgs.builder()
 *                 .name("example rule")
 *                 .condition("http.request.uri.path contains \"testing\"")
 *                 .fixedResponse(LoadBalancerRuleFixedResponseArgs.builder()
 *                     .messageBody("hello")
 *                     .statusCode(200)
 *                     .contentType("html")
 *                     .location("www.example.com")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # Define a load balancer which always points to a pool we define below.
 *   # In normal usage, would have different pools set for different pops
 *   # (cloudflare points-of-presence) and/or for different regions.
 *   # Within each pop or region we can define multiple pools in failover order.
 *   example:
 *     type: cloudflare:LoadBalancer
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       name: example-load-balancer.example.com
 *       fallbackPoolId: ${exampleLoadBalancerPool.id}
 *       defaultPoolIds:
 *         - ${exampleLoadBalancerPool.id}
 *       description: example load balancer using geo-balancing
 *       proxied: true
 *       steeringPolicy: geo
 *       popPools:
 *         - pop: LAX
 *           poolIds:
 *             - ${exampleLoadBalancerPool.id}
 *       countryPools:
 *         - country: US
 *           poolIds:
 *             - ${exampleLoadBalancerPool.id}
 *       regionPools:
 *         - region: WNAM
 *           poolIds:
 *             - ${exampleLoadBalancerPool.id}
 *       rules:
 *         - name: example rule
 *           condition: http.request.uri.path contains "testing"
 *           fixedResponse:
 *             messageBody: hello
 *             statusCode: 200
 *             contentType: html
 *             location: www.example.com
 *   exampleLoadBalancerPool:
 *     type: cloudflare:LoadBalancerPool
 *     name: example
 *     properties:
 *       name: example-lb-pool
 *       origins:
 *         - name: example-1
 *           address: 192.0.2.1
 *           enabled: false
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/loadBalancer:LoadBalancer example /
 * ```
 * @property adaptiveRoutings Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
 * @property countryPools A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
 * @property defaultPoolIds A list of pool IDs ordered by their failover priority. Used whenever `pop_pools`/`country_pools`/`region_pools` are not defined.
 * @property description Free text description.
 * @property enabled Enable or disable the load balancer. Defaults to `true`.
 * @property fallbackPoolId The pool ID to use when all other pools are detected as unhealthy.
 * @property locationStrategies Controls location-based steering for non-proxied requests.
 * @property name The DNS hostname to associate with your load balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the load balancer will take precedence and the DNS record will not be used.
 * @property popPools A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
 * @property proxied Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. Conflicts with `ttl`.
 * @property randomSteerings Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
 * @property regionPools A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
 * @property rules A list of rules for this load balancer to execute.
 * @property sessionAffinity Specifies the type of session affinity the load balancer should use unless specified as `none` or `""` (default). With value `cookie`, on the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy then a new origin server is calculated and used. Value `ip_cookie` behaves the same as `cookie` except the initial origin selection is stable and based on the client's IP address. Available values: `""`, `none`, `cookie`, `ip_cookie`, `header`. Defaults to `none`.
 * @property sessionAffinityAttributes Configure attributes for session affinity.
 * @property sessionAffinityTtl Time, in seconds, until this load balancer's session affinity cookie expires after being created. This parameter is ignored unless a supported session affinity policy is set. The current default of `82800` (23 hours) will be used unless `session_affinity_ttl` is explicitly set. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. Valid values are between `1800` and `604800`.
 * @property steeringPolicy The method the load balancer uses to determine the route to your origin. Value `off` uses `default_pool_ids`. Value `geo` uses `pop_pools`/`country_pools`/`region_pools`. For non-proxied requests, the `country` for `country_pools` is determined by `location_strategy`. Value `random` selects a pool randomly. Value `dynamic_latency` uses round trip time to select the closest pool in `default_pool_ids` (requires pool health checks). Value `proximity` uses the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. Value `least_outstanding_requests` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. Value `least_connections` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. Value `""` maps to `geo` if you use `pop_pools`/`country_pools`/`region_pools` otherwise `off`. Available values: `off`, `geo`, `dynamic_latency`, `random`, `proximity`, `least_outstanding_requests`, `least_connections`, `""` Defaults to `""`.
 * @property ttl Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This cannot be set for proxied load balancers. Defaults to `30`. Conflicts with `proxied`.
 * @property zoneId The zone ID to add the load balancer to. **Modifying this attribute will force creation of a new resource.**
 */
public data class LoadBalancerArgs(
    public val adaptiveRoutings: Output>? = null,
    public val countryPools: Output>? = null,
    public val defaultPoolIds: Output>? = null,
    public val description: Output? = null,
    public val enabled: Output? = null,
    public val fallbackPoolId: Output? = null,
    public val locationStrategies: Output>? = null,
    public val name: Output? = null,
    public val popPools: Output>? = null,
    public val proxied: Output? = null,
    public val randomSteerings: Output>? = null,
    public val regionPools: Output>? = null,
    public val rules: Output>? = null,
    public val sessionAffinity: Output? = null,
    public val sessionAffinityAttributes: Output>? =
        null,
    public val sessionAffinityTtl: Output? = null,
    public val steeringPolicy: Output? = null,
    public val ttl: Output? = null,
    public val zoneId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.LoadBalancerArgs =
        com.pulumi.cloudflare.LoadBalancerArgs.builder()
            .adaptiveRoutings(
                adaptiveRoutings?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .countryPools(
                countryPools?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .defaultPoolIds(defaultPoolIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .fallbackPoolId(fallbackPoolId?.applyValue({ args0 -> args0 }))
            .locationStrategies(
                locationStrategies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .popPools(
                popPools?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .proxied(proxied?.applyValue({ args0 -> args0 }))
            .randomSteerings(
                randomSteerings?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .regionPools(
                regionPools?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .rules(rules?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .sessionAffinity(sessionAffinity?.applyValue({ args0 -> args0 }))
            .sessionAffinityAttributes(
                sessionAffinityAttributes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .sessionAffinityTtl(sessionAffinityTtl?.applyValue({ args0 -> args0 }))
            .steeringPolicy(steeringPolicy?.applyValue({ args0 -> args0 }))
            .ttl(ttl?.applyValue({ args0 -> args0 }))
            .zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}

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

    private var countryPools: Output>? = null

    private var defaultPoolIds: Output>? = null

    private var description: Output? = null

    private var enabled: Output? = null

    private var fallbackPoolId: Output? = null

    private var locationStrategies: Output>? = null

    private var name: Output? = null

    private var popPools: Output>? = null

    private var proxied: Output? = null

    private var randomSteerings: Output>? = null

    private var regionPools: Output>? = null

    private var rules: Output>? = null

    private var sessionAffinity: Output? = null

    private var sessionAffinityAttributes: Output>? =
        null

    private var sessionAffinityTtl: Output? = null

    private var steeringPolicy: Output? = null

    private var ttl: Output? = null

    private var zoneId: Output? = null

    /**
     * @param value Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("xbxmqyujpcfrngjm")
    public suspend fun adaptiveRoutings(`value`: Output>) {
        this.adaptiveRoutings = value
    }

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

    /**
     * @param values Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("hnnpjunyqxlfffow")
    public suspend fun adaptiveRoutings(values: List>) {
        this.adaptiveRoutings = Output.all(values)
    }

    /**
     * @param value A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("lwcekpqqyecrnmln")
    public suspend fun countryPools(`value`: Output>) {
        this.countryPools = value
    }

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

    /**
     * @param values A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("kxtkmdpfkflyhdri")
    public suspend fun countryPools(values: List>) {
        this.countryPools = Output.all(values)
    }

    /**
     * @param value A list of pool IDs ordered by their failover priority. Used whenever `pop_pools`/`country_pools`/`region_pools` are not defined.
     */
    @JvmName("jeeietueulyaiipv")
    public suspend fun defaultPoolIds(`value`: Output>) {
        this.defaultPoolIds = value
    }

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

    /**
     * @param values A list of pool IDs ordered by their failover priority. Used whenever `pop_pools`/`country_pools`/`region_pools` are not defined.
     */
    @JvmName("bhknrbuhausenori")
    public suspend fun defaultPoolIds(values: List>) {
        this.defaultPoolIds = Output.all(values)
    }

    /**
     * @param value Free text description.
     */
    @JvmName("eqojamppfpsqiutc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Enable or disable the load balancer. Defaults to `true`.
     */
    @JvmName("canvujkrilbeafmc")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value The pool ID to use when all other pools are detected as unhealthy.
     */
    @JvmName("ojybqokglrlondmm")
    public suspend fun fallbackPoolId(`value`: Output) {
        this.fallbackPoolId = value
    }

    /**
     * @param value Controls location-based steering for non-proxied requests.
     */
    @JvmName("oiqjmbcaccwuffix")
    public suspend fun locationStrategies(`value`: Output>) {
        this.locationStrategies = value
    }

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

    /**
     * @param values Controls location-based steering for non-proxied requests.
     */
    @JvmName("tgoclwoholnbmbbm")
    public suspend fun locationStrategies(values: List>) {
        this.locationStrategies = Output.all(values)
    }

    /**
     * @param value The DNS hostname to associate with your load balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the load balancer will take precedence and the DNS record will not be used.
     */
    @JvmName("tbfqqjdddjvacsmb")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("wpdrhiyknslbyjlc")
    public suspend fun popPools(`value`: Output>) {
        this.popPools = value
    }

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

    /**
     * @param values A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("mgfnypujreqcyrmr")
    public suspend fun popPools(values: List>) {
        this.popPools = Output.all(values)
    }

    /**
     * @param value Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. Conflicts with `ttl`.
     */
    @JvmName("ydupflyhousouylt")
    public suspend fun proxied(`value`: Output) {
        this.proxied = value
    }

    /**
     * @param value Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("dlaguljvyuiduqdb")
    public suspend fun randomSteerings(`value`: Output>) {
        this.randomSteerings = value
    }

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

    /**
     * @param values Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("lljxcikijtnkqaqa")
    public suspend fun randomSteerings(values: List>) {
        this.randomSteerings = Output.all(values)
    }

    /**
     * @param value A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("yybpedocyivfwswb")
    public suspend fun regionPools(`value`: Output>) {
        this.regionPools = value
    }

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

    /**
     * @param values A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("wldyaingmqrfkcex")
    public suspend fun regionPools(values: List>) {
        this.regionPools = Output.all(values)
    }

    /**
     * @param value A list of rules for this load balancer to execute.
     */
    @JvmName("xteaoxgmlywvdxpn")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values A list of rules for this load balancer to execute.
     */
    @JvmName("fwkpwidjdlitempw")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value Specifies the type of session affinity the load balancer should use unless specified as `none` or `""` (default). With value `cookie`, on the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy then a new origin server is calculated and used. Value `ip_cookie` behaves the same as `cookie` except the initial origin selection is stable and based on the client's IP address. Available values: `""`, `none`, `cookie`, `ip_cookie`, `header`. Defaults to `none`.
     */
    @JvmName("ipflludhaqccgnxf")
    public suspend fun sessionAffinity(`value`: Output) {
        this.sessionAffinity = value
    }

    /**
     * @param value Configure attributes for session affinity.
     */
    @JvmName("gkkncfdydaidsbfo")
    public suspend fun sessionAffinityAttributes(`value`: Output>) {
        this.sessionAffinityAttributes = value
    }

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

    /**
     * @param values Configure attributes for session affinity.
     */
    @JvmName("nnohjvrlouebnvph")
    public suspend fun sessionAffinityAttributes(values: List>) {
        this.sessionAffinityAttributes = Output.all(values)
    }

    /**
     * @param value Time, in seconds, until this load balancer's session affinity cookie expires after being created. This parameter is ignored unless a supported session affinity policy is set. The current default of `82800` (23 hours) will be used unless `session_affinity_ttl` is explicitly set. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. Valid values are between `1800` and `604800`.
     */
    @JvmName("qasgcfelviieibkd")
    public suspend fun sessionAffinityTtl(`value`: Output) {
        this.sessionAffinityTtl = value
    }

    /**
     * @param value The method the load balancer uses to determine the route to your origin. Value `off` uses `default_pool_ids`. Value `geo` uses `pop_pools`/`country_pools`/`region_pools`. For non-proxied requests, the `country` for `country_pools` is determined by `location_strategy`. Value `random` selects a pool randomly. Value `dynamic_latency` uses round trip time to select the closest pool in `default_pool_ids` (requires pool health checks). Value `proximity` uses the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. Value `least_outstanding_requests` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. Value `least_connections` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. Value `""` maps to `geo` if you use `pop_pools`/`country_pools`/`region_pools` otherwise `off`. Available values: `off`, `geo`, `dynamic_latency`, `random`, `proximity`, `least_outstanding_requests`, `least_connections`, `""` Defaults to `""`.
     */
    @JvmName("vcphlvruaupapamj")
    public suspend fun steeringPolicy(`value`: Output) {
        this.steeringPolicy = value
    }

    /**
     * @param value Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This cannot be set for proxied load balancers. Defaults to `30`. Conflicts with `proxied`.
     */
    @JvmName("bbocgsucavwskivb")
    public suspend fun ttl(`value`: Output) {
        this.ttl = value
    }

    /**
     * @param value The zone ID to add the load balancer to. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("todhxprsdrhxbriy")
    public suspend fun zoneId(`value`: Output) {
        this.zoneId = value
    }

    /**
     * @param value Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("sjdefmgosjrvvlgc")
    public suspend fun adaptiveRoutings(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.adaptiveRoutings = mapped
    }

    /**
     * @param argument Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("jaemclgxusyyafxf")
    public suspend fun adaptiveRoutings(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerAdaptiveRoutingArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.adaptiveRoutings = mapped
    }

    /**
     * @param argument Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("hpoqjgssbkdaltco")
    public suspend fun adaptiveRoutings(vararg argument: suspend LoadBalancerAdaptiveRoutingArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerAdaptiveRoutingArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.adaptiveRoutings = mapped
    }

    /**
     * @param argument Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("uaqwtxctverxnryx")
    public suspend fun adaptiveRoutings(argument: suspend LoadBalancerAdaptiveRoutingArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerAdaptiveRoutingArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.adaptiveRoutings = mapped
    }

    /**
     * @param values Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests.
     */
    @JvmName("jtvxpkqwqbpompku")
    public suspend fun adaptiveRoutings(vararg values: LoadBalancerAdaptiveRoutingArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.adaptiveRoutings = mapped
    }

    /**
     * @param value A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("ntwlxyagadexgqow")
    public suspend fun countryPools(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.countryPools = mapped
    }

    /**
     * @param argument A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("lotajcopecouflqv")
    public suspend fun countryPools(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerCountryPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.countryPools = mapped
    }

    /**
     * @param argument A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("awrbonufcqxlmnjq")
    public suspend fun countryPools(vararg argument: suspend LoadBalancerCountryPoolArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerCountryPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.countryPools = mapped
    }

    /**
     * @param argument A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("hsarbtdawgyiphre")
    public suspend fun countryPools(argument: suspend LoadBalancerCountryPoolArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerCountryPoolArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.countryPools = mapped
    }

    /**
     * @param values A set containing mappings of country codes to a list of pool IDs (ordered by their failover priority) for the given country.
     */
    @JvmName("cudujmncjrpofxjl")
    public suspend fun countryPools(vararg values: LoadBalancerCountryPoolArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.countryPools = mapped
    }

    /**
     * @param value A list of pool IDs ordered by their failover priority. Used whenever `pop_pools`/`country_pools`/`region_pools` are not defined.
     */
    @JvmName("ukotalhnsjffroac")
    public suspend fun defaultPoolIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultPoolIds = mapped
    }

    /**
     * @param values A list of pool IDs ordered by their failover priority. Used whenever `pop_pools`/`country_pools`/`region_pools` are not defined.
     */
    @JvmName("irxwkjdbfwchwxvb")
    public suspend fun defaultPoolIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.defaultPoolIds = mapped
    }

    /**
     * @param value Free text description.
     */
    @JvmName("pntaffnfootxvagt")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Enable or disable the load balancer. Defaults to `true`.
     */
    @JvmName("jhyjryjmnorwkvtb")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value The pool ID to use when all other pools are detected as unhealthy.
     */
    @JvmName("jjfvnohclhvlmqmr")
    public suspend fun fallbackPoolId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fallbackPoolId = mapped
    }

    /**
     * @param value Controls location-based steering for non-proxied requests.
     */
    @JvmName("xfgbqngrqoiktgbe")
    public suspend fun locationStrategies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.locationStrategies = mapped
    }

    /**
     * @param argument Controls location-based steering for non-proxied requests.
     */
    @JvmName("lfwgqliiwlsceogp")
    public suspend fun locationStrategies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerLocationStrategyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.locationStrategies = mapped
    }

    /**
     * @param argument Controls location-based steering for non-proxied requests.
     */
    @JvmName("tqgfpoeetvqyljbl")
    public suspend fun locationStrategies(vararg argument: suspend LoadBalancerLocationStrategyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerLocationStrategyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.locationStrategies = mapped
    }

    /**
     * @param argument Controls location-based steering for non-proxied requests.
     */
    @JvmName("gqqlssurpxektrkm")
    public suspend fun locationStrategies(argument: suspend LoadBalancerLocationStrategyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerLocationStrategyArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.locationStrategies = mapped
    }

    /**
     * @param values Controls location-based steering for non-proxied requests.
     */
    @JvmName("rkeulrrhtohgaijj")
    public suspend fun locationStrategies(vararg values: LoadBalancerLocationStrategyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.locationStrategies = mapped
    }

    /**
     * @param value The DNS hostname to associate with your load balancer. If this hostname already exists as a DNS record in Cloudflare's DNS, the load balancer will take precedence and the DNS record will not be used.
     */
    @JvmName("ntqyqwoxnepdjvgp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("esagmginhtpgoqtm")
    public suspend fun popPools(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.popPools = mapped
    }

    /**
     * @param argument A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("cwuccolustqlqrla")
    public suspend fun popPools(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerPopPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.popPools = mapped
    }

    /**
     * @param argument A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("pbcynsbephfucjgx")
    public suspend fun popPools(vararg argument: suspend LoadBalancerPopPoolArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerPopPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.popPools = mapped
    }

    /**
     * @param argument A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("nxwqymeygtetybed")
    public suspend fun popPools(argument: suspend LoadBalancerPopPoolArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(LoadBalancerPopPoolArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.popPools = mapped
    }

    /**
     * @param values A set containing mappings of Cloudflare Point-of-Presence (PoP) identifiers to a list of pool IDs (ordered by their failover priority) for the PoP (datacenter). This feature is only available to enterprise customers.
     */
    @JvmName("nqfxwdovlkhytpul")
    public suspend fun popPools(vararg values: LoadBalancerPopPoolArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.popPools = mapped
    }

    /**
     * @param value Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. Conflicts with `ttl`.
     */
    @JvmName("ihvhykmkhvekrmmg")
    public suspend fun proxied(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.proxied = mapped
    }

    /**
     * @param value Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("rwctifesvauatiik")
    public suspend fun randomSteerings(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.randomSteerings = mapped
    }

    /**
     * @param argument Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("sqqodhpnxfmjxweh")
    public suspend fun randomSteerings(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRandomSteeringArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.randomSteerings = mapped
    }

    /**
     * @param argument Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("nrdbhfvrwpwlyivp")
    public suspend fun randomSteerings(vararg argument: suspend LoadBalancerRandomSteeringArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRandomSteeringArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.randomSteerings = mapped
    }

    /**
     * @param argument Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("tnxpdxcftwhcderd")
    public suspend fun randomSteerings(argument: suspend LoadBalancerRandomSteeringArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerRandomSteeringArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.randomSteerings = mapped
    }

    /**
     * @param values Configures pool weights. When `steering_policy="random"`, a random pool is selected with probability proportional to pool weights. When `steering_policy="least_outstanding_requests"`, pool weights are used to scale each pool's outstanding requests. When `steering_policy="least_connections"`, pool weights are used to scale each pool's open connections.
     */
    @JvmName("ijiianlgiyfmiave")
    public suspend fun randomSteerings(vararg values: LoadBalancerRandomSteeringArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.randomSteerings = mapped
    }

    /**
     * @param value A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("oiaailyiqkxeocdf")
    public suspend fun regionPools(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.regionPools = mapped
    }

    /**
     * @param argument A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("jyxvkujhpryeanim")
    public suspend fun regionPools(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRegionPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.regionPools = mapped
    }

    /**
     * @param argument A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("paofnubltjykagrq")
    public suspend fun regionPools(vararg argument: suspend LoadBalancerRegionPoolArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRegionPoolArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.regionPools = mapped
    }

    /**
     * @param argument A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("vnrlblttystudbrv")
    public suspend fun regionPools(argument: suspend LoadBalancerRegionPoolArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(LoadBalancerRegionPoolArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.regionPools = mapped
    }

    /**
     * @param values A set containing mappings of region codes to a list of pool IDs (ordered by their failover priority) for the given region.
     */
    @JvmName("pahdosvihcarbkqk")
    public suspend fun regionPools(vararg values: LoadBalancerRegionPoolArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.regionPools = mapped
    }

    /**
     * @param value A list of rules for this load balancer to execute.
     */
    @JvmName("tbrlxivjhprrttom")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument A list of rules for this load balancer to execute.
     */
    @JvmName("nrisdojvuxrpfooc")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A list of rules for this load balancer to execute.
     */
    @JvmName("vvlmxfedkaobmuuv")
    public suspend fun rules(vararg argument: suspend LoadBalancerRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A list of rules for this load balancer to execute.
     */
    @JvmName("jdawtoiqpbqfheny")
    public suspend fun rules(argument: suspend LoadBalancerRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(LoadBalancerRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values A list of rules for this load balancer to execute.
     */
    @JvmName("cijkcitexqrnlfpt")
    public suspend fun rules(vararg values: LoadBalancerRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param value Specifies the type of session affinity the load balancer should use unless specified as `none` or `""` (default). With value `cookie`, on the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy then a new origin server is calculated and used. Value `ip_cookie` behaves the same as `cookie` except the initial origin selection is stable and based on the client's IP address. Available values: `""`, `none`, `cookie`, `ip_cookie`, `header`. Defaults to `none`.
     */
    @JvmName("gfvgeaywgiflnkis")
    public suspend fun sessionAffinity(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sessionAffinity = mapped
    }

    /**
     * @param value Configure attributes for session affinity.
     */
    @JvmName("msjatqimrqffcrhu")
    public suspend fun sessionAffinityAttributes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sessionAffinityAttributes = mapped
    }

    /**
     * @param argument Configure attributes for session affinity.
     */
    @JvmName("trfftvehwraddbdo")
    public suspend fun sessionAffinityAttributes(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LoadBalancerSessionAffinityAttributeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sessionAffinityAttributes = mapped
    }

    /**
     * @param argument Configure attributes for session affinity.
     */
    @JvmName("jgirudurojfusvci")
    public suspend fun sessionAffinityAttributes(vararg argument: suspend LoadBalancerSessionAffinityAttributeArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LoadBalancerSessionAffinityAttributeArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sessionAffinityAttributes = mapped
    }

    /**
     * @param argument Configure attributes for session affinity.
     */
    @JvmName("kgsgdcoomrmsngdi")
    public suspend fun sessionAffinityAttributes(argument: suspend LoadBalancerSessionAffinityAttributeArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LoadBalancerSessionAffinityAttributeArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.sessionAffinityAttributes = mapped
    }

    /**
     * @param values Configure attributes for session affinity.
     */
    @JvmName("idplnumxambtbymo")
    public suspend fun sessionAffinityAttributes(vararg values: LoadBalancerSessionAffinityAttributeArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sessionAffinityAttributes = mapped
    }

    /**
     * @param value Time, in seconds, until this load balancer's session affinity cookie expires after being created. This parameter is ignored unless a supported session affinity policy is set. The current default of `82800` (23 hours) will be used unless `session_affinity_ttl` is explicitly set. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. Valid values are between `1800` and `604800`.
     */
    @JvmName("afwqxygktewlkahp")
    public suspend fun sessionAffinityTtl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sessionAffinityTtl = mapped
    }

    /**
     * @param value The method the load balancer uses to determine the route to your origin. Value `off` uses `default_pool_ids`. Value `geo` uses `pop_pools`/`country_pools`/`region_pools`. For non-proxied requests, the `country` for `country_pools` is determined by `location_strategy`. Value `random` selects a pool randomly. Value `dynamic_latency` uses round trip time to select the closest pool in `default_pool_ids` (requires pool health checks). Value `proximity` uses the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests. Value `least_outstanding_requests` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others. Value `least_connections` selects a pool by taking into consideration `random_steering` weights, as well as each pool's number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections. Value `""` maps to `geo` if you use `pop_pools`/`country_pools`/`region_pools` otherwise `off`. Available values: `off`, `geo`, `dynamic_latency`, `random`, `proximity`, `least_outstanding_requests`, `least_connections`, `""` Defaults to `""`.
     */
    @JvmName("hkreooxbxbpnlinf")
    public suspend fun steeringPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.steeringPolicy = mapped
    }

    /**
     * @param value Time to live (TTL) of the DNS entry for the IP address returned by this load balancer. This cannot be set for proxied load balancers. Defaults to `30`. Conflicts with `proxied`.
     */
    @JvmName("qlnudgsovrgitylm")
    public suspend fun ttl(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ttl = mapped
    }

    /**
     * @param value The zone ID to add the load balancer to. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("iveqgnoxjucatmtn")
    public suspend fun zoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneId = mapped
    }

    internal fun build(): LoadBalancerArgs = LoadBalancerArgs(
        adaptiveRoutings = adaptiveRoutings,
        countryPools = countryPools,
        defaultPoolIds = defaultPoolIds,
        description = description,
        enabled = enabled,
        fallbackPoolId = fallbackPoolId,
        locationStrategies = locationStrategies,
        name = name,
        popPools = popPools,
        proxied = proxied,
        randomSteerings = randomSteerings,
        regionPools = regionPools,
        rules = rules,
        sessionAffinity = sessionAffinity,
        sessionAffinityAttributes = sessionAffinityAttributes,
        sessionAffinityTtl = sessionAffinityTtl,
        steeringPolicy = steeringPolicy,
        ttl = ttl,
        zoneId = zoneId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy