import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "./types"; /** * 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 pulumi_cloudflare from "@mapped/pulumi-cloudflare"; * * const foo = new cloudflare.LoadBalancerPool("foo", { * 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 bar = new cloudflare.LoadBalancer("bar", { * zoneId: "d41d8cd98f00b204e9800998ecf8427e", * name: "example-load-balancer.example.com", * fallbackPoolId: foo.id, * defaultPoolIds: [foo.id], * description: "example load balancer using geo-balancing", * proxied: true, * steeringPolicy: "geo", * popPools: [{ * pop: "LAX", * poolIds: [foo.id], * }], * regionPools: [{ * region: "WNAM", * poolIds: [foo.id], * }], * rules: [{ * name: "example rule", * condition: "http.request.uri.path contains \"testing\"", * fixedResponse: { * messageBody: "hello", * statusCode: 200, * contentType: "html", * location: "www.example.com", * }, * }], * }); * ``` */ export declare class LoadBalancer extends pulumi.CustomResource { /** * Get an existing LoadBalancer resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: LoadBalancerState, opts?: pulumi.CustomResourceOptions): LoadBalancer; /** * Returns true if the given object is an instance of LoadBalancer. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is LoadBalancer; /** * The RFC3339 timestamp of when the load balancer was created. */ readonly createdOn: pulumi.Output; /** * A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined. */ readonly defaultPoolIds: pulumi.Output; /** * Free text description. */ readonly description: pulumi.Output; /** * Enable or disable the load balancer. Defaults to `true` (enabled). */ readonly enabled: pulumi.Output; /** * The pool ID to use when all other pools are detected as unhealthy. */ readonly fallbackPoolId: pulumi.Output; /** * The RFC3339 timestamp of when the load balancer was last modified. */ readonly modifiedOn: pulumi.Output; /** * Human readable name for this rule. */ readonly name: pulumi.Output; /** * See popPools above. */ readonly popPools: pulumi.Output; /** * Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. */ readonly proxied: pulumi.Output; /** * See regionPools above. */ readonly regionPools: pulumi.Output; /** * A list of conditions and overrides for each load balancer operation. See the field documentation below. */ readonly rules: pulumi.Output; /** * See field above. */ readonly sessionAffinity: pulumi.Output; /** * See field above. */ readonly sessionAffinityAttributes: pulumi.Output<{ [key: string]: string; } | undefined>; /** * See field above. */ readonly sessionAffinityTtl: pulumi.Output; /** * See field above. */ readonly steeringPolicy: pulumi.Output; /** * See field above. */ readonly ttl: pulumi.Output; /** * The zone ID to add the load balancer to. */ readonly zoneId: pulumi.Output; /** * Create a LoadBalancer resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: LoadBalancerArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering LoadBalancer resources. */ export interface LoadBalancerState { /** * The RFC3339 timestamp of when the load balancer was created. */ createdOn?: pulumi.Input; /** * A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined. */ defaultPoolIds?: pulumi.Input[]>; /** * Free text description. */ description?: pulumi.Input; /** * Enable or disable the load balancer. Defaults to `true` (enabled). */ enabled?: pulumi.Input; /** * The pool ID to use when all other pools are detected as unhealthy. */ fallbackPoolId?: pulumi.Input; /** * The RFC3339 timestamp of when the load balancer was last modified. */ modifiedOn?: pulumi.Input; /** * Human readable name for this rule. */ name?: pulumi.Input; /** * See popPools above. */ popPools?: pulumi.Input[]>; /** * Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. */ proxied?: pulumi.Input; /** * See regionPools above. */ regionPools?: pulumi.Input[]>; /** * A list of conditions and overrides for each load balancer operation. See the field documentation below. */ rules?: pulumi.Input[]>; /** * See field above. */ sessionAffinity?: pulumi.Input; /** * See field above. */ sessionAffinityAttributes?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * See field above. */ sessionAffinityTtl?: pulumi.Input; /** * See field above. */ steeringPolicy?: pulumi.Input; /** * See field above. */ ttl?: pulumi.Input; /** * The zone ID to add the load balancer to. */ zoneId?: pulumi.Input; } /** * The set of arguments for constructing a LoadBalancer resource. */ export interface LoadBalancerArgs { /** * A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined. */ defaultPoolIds: pulumi.Input[]>; /** * Free text description. */ description?: pulumi.Input; /** * Enable or disable the load balancer. Defaults to `true` (enabled). */ enabled?: pulumi.Input; /** * The pool ID to use when all other pools are detected as unhealthy. */ fallbackPoolId: pulumi.Input; /** * Human readable name for this rule. */ name: pulumi.Input; /** * See popPools above. */ popPools?: pulumi.Input[]>; /** * Whether the hostname gets Cloudflare's origin protection. Defaults to `false`. */ proxied?: pulumi.Input; /** * See regionPools above. */ regionPools?: pulumi.Input[]>; /** * A list of conditions and overrides for each load balancer operation. See the field documentation below. */ rules?: pulumi.Input[]>; /** * See field above. */ sessionAffinity?: pulumi.Input; /** * See field above. */ sessionAffinityAttributes?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * See field above. */ sessionAffinityTtl?: pulumi.Input; /** * See field above. */ steeringPolicy?: pulumi.Input; /** * See field above. */ ttl?: pulumi.Input; /** * The zone ID to add the load balancer to. */ zoneId: pulumi.Input; }