LoadBalancer
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.
Create a LoadBalancer Resource
new LoadBalancer(name: string, args: LoadBalancerArgs, opts?: CustomResourceOptions);def LoadBalancer(resource_name, opts=None, default_pool_ids=None, description=None, enabled=None, fallback_pool_id=None, name=None, pop_pools=None, proxied=None, region_pools=None, session_affinity=None, steering_policy=None, ttl=None, zone_id=None, __props__=None);func NewLoadBalancer(ctx *Context, name string, args LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)public LoadBalancer(string name, LoadBalancerArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args LoadBalancerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LoadBalancerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
LoadBalancer Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The LoadBalancer resource accepts the following input properties:
- Default
Pool List<string>Ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- Fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- Name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- Zone
Id string The zone ID to add the load balancer to.
- Description string
Free text description.
- Enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- Pop
Pools List<LoadBalancer Pop Pool Args> 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. Fields documented below.
- Proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- Region
Pools List<LoadBalancer Region Pool Args> A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- Session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- Steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- Ttl int
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.
- Default
Pool []stringIds A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- Fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- Name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- Zone
Id string The zone ID to add the load balancer to.
- Description string
Free text description.
- Enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- Pop
Pools []LoadBalancer Pop Pool 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. Fields documented below.
- Proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- Region
Pools []LoadBalancer Region Pool A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- Session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- Steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- Ttl int
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.
- default
Pool string[]Ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- zone
Id string The zone ID to add the load balancer to.
- description string
Free text description.
- enabled boolean
Enable or disable the load balancer. Defaults to
true(enabled).- pop
Pools LoadBalancer Pop Pool[] 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. Fields documented below.
- proxied boolean
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- region
Pools LoadBalancer Region Pool[] A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- ttl number
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.
- default_
pool_ List[str]ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- fallback_
pool_ strid The pool ID to use when all other pools are detected as unhealthy.
- name str
The DNS name (FQDN, including the zone) to associate with the load balancer.
- zone_
id str The zone ID to add the load balancer to.
- description str
Free text description.
- enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- pop_
pools List[LoadBalancer Pop Pool] 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. Fields documented below.
- proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- region_
pools List[LoadBalancer Region Pool] A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- session_
affinity str Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- steering_
policy str Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- ttl float
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadBalancer resource produces the following output properties:
- created_
on str The RFC3339 timestamp of when the load balancer was created.
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
on str The RFC3339 timestamp of when the load balancer was last modified.
Look up an Existing LoadBalancer Resource
Get an existing LoadBalancer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LoadBalancerState, opts?: CustomResourceOptions): LoadBalancerstatic get(resource_name, id, opts=None, created_on=None, default_pool_ids=None, description=None, enabled=None, fallback_pool_id=None, modified_on=None, name=None, pop_pools=None, proxied=None, region_pools=None, session_affinity=None, steering_policy=None, ttl=None, zone_id=None, __props__=None);func GetLoadBalancer(ctx *Context, name string, id IDInput, state *LoadBalancerState, opts ...ResourceOption) (*LoadBalancer, error)public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Created
On string The RFC3339 timestamp of when the load balancer was created.
- Default
Pool List<string>Ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- Description string
Free text description.
- Enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- Fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- Modified
On string The RFC3339 timestamp of when the load balancer was last modified.
- Name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- Pop
Pools List<LoadBalancer Pop Pool Args> 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. Fields documented below.
- Proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- Region
Pools List<LoadBalancer Region Pool Args> A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- Session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- Steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- Ttl int
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.- Zone
Id string The zone ID to add the load balancer to.
- Created
On string The RFC3339 timestamp of when the load balancer was created.
- Default
Pool []stringIds A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- Description string
Free text description.
- Enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- Fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- Modified
On string The RFC3339 timestamp of when the load balancer was last modified.
- Name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- Pop
Pools []LoadBalancer Pop Pool 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. Fields documented below.
- Proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- Region
Pools []LoadBalancer Region Pool A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- Session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- Steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- Ttl int
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.- Zone
Id string The zone ID to add the load balancer to.
- created
On string The RFC3339 timestamp of when the load balancer was created.
- default
Pool string[]Ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- description string
Free text description.
- enabled boolean
Enable or disable the load balancer. Defaults to
true(enabled).- fallback
Pool stringId The pool ID to use when all other pools are detected as unhealthy.
- modified
On string The RFC3339 timestamp of when the load balancer was last modified.
- name string
The DNS name (FQDN, including the zone) to associate with the load balancer.
- pop
Pools LoadBalancer Pop Pool[] 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. Fields documented below.
- proxied boolean
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- region
Pools LoadBalancer Region Pool[] A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- session
Affinity string Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- steering
Policy string Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- ttl number
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.- zone
Id string The zone ID to add the load balancer to.
- created_
on str The RFC3339 timestamp of when the load balancer was created.
- default_
pool_ List[str]ids A list of pool IDs ordered by their failover priority. Used whenever region/pop pools are not defined.
- description str
Free text description.
- enabled bool
Enable or disable the load balancer. Defaults to
true(enabled).- fallback_
pool_ strid The pool ID to use when all other pools are detected as unhealthy.
- modified_
on str The RFC3339 timestamp of when the load balancer was last modified.
- name str
The DNS name (FQDN, including the zone) to associate with the load balancer.
- pop_
pools List[LoadBalancer Pop Pool] 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. Fields documented below.
- proxied bool
Whether the hostname gets Cloudflare’s origin protection. Defaults to
false.- region_
pools List[LoadBalancer Region Pool] A set containing mappings of region/country codes to a list of pool IDs (ordered by their failover priority) for the given region. Fields documented below.
- session_
affinity str Associates all requests coming from an end-user with a single origin. Cloudflare will set a cookie on the initial response to the client, such that consequent requests with the cookie in the request will go to the same origin, so long as it is available. Valid values are:
"","none","cookie", and"ip_cookie". Default is"".- steering_
policy str Determine which method the load balancer uses to determine the fastest route to your origin. Valid values are:
"off","geo","dynamic_latency","random"or"". Default is"".- ttl float
Time to live (TTL) of this load balancer’s DNS
name. Conflicts withproxied- this cannot be set for proxied load balancers. Default is30.- zone_
id str The zone ID to add the load balancer to.
Supporting Types
LoadBalancerPopPool
- Pool
Ids List<string> A list of pool IDs in failover priority to use for traffic reaching the given PoP.
- Pop string
A 3-letter code for the Point-of-Presence. Allowed values can be found in the list of datacenters on the status page. Multiple entries should not be specified with the same PoP.
- Pool
Ids []string A list of pool IDs in failover priority to use for traffic reaching the given PoP.
- Pop string
A 3-letter code for the Point-of-Presence. Allowed values can be found in the list of datacenters on the status page. Multiple entries should not be specified with the same PoP.
- pool
Ids string[] A list of pool IDs in failover priority to use for traffic reaching the given PoP.
- pop string
A 3-letter code for the Point-of-Presence. Allowed values can be found in the list of datacenters on the status page. Multiple entries should not be specified with the same PoP.
- pool
Ids List[str] A list of pool IDs in failover priority to use for traffic reaching the given PoP.
- pop str
A 3-letter code for the Point-of-Presence. Allowed values can be found in the list of datacenters on the status page. Multiple entries should not be specified with the same PoP.
LoadBalancerRegionPool
- Pool
Ids List<string> A list of pool IDs in failover priority to use for traffic reaching the given PoP.
- Region string
A region code which must be in the list defined here. Multiple entries should not be specified with the same region.
Package Details
- Repository
- https://github.com/pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflareTerraform Provider.