gcp.networkservices.ServiceLbPolicies
Explore with Pulumi AI
Example Usage
Network Services Service Lb Policies Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.networkservices.ServiceLbPolicies("default", {
name: "my-lb-policy",
location: "global",
});
import pulumi
import pulumi_gcp as gcp
default = gcp.networkservices.ServiceLbPolicies("default",
name="my-lb-policy",
location="global")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networkservices.NewServiceLbPolicies(ctx, "default", &networkservices.ServiceLbPoliciesArgs{
Name: pulumi.String("my-lb-policy"),
Location: pulumi.String("global"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.NetworkServices.ServiceLbPolicies("default", new()
{
Name = "my-lb-policy",
Location = "global",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkservices.ServiceLbPolicies;
import com.pulumi.gcp.networkservices.ServiceLbPoliciesArgs;
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 default_ = new ServiceLbPolicies("default", ServiceLbPoliciesArgs.builder()
.name("my-lb-policy")
.location("global")
.build());
}
}
resources:
default:
type: gcp:networkservices:ServiceLbPolicies
properties:
name: my-lb-policy
location: global
Network Services Service Lb Policies Advanced
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.networkservices.ServiceLbPolicies("default", {
name: "my-lb-policy",
location: "global",
description: "my description",
loadBalancingAlgorithm: "SPRAY_TO_REGION",
autoCapacityDrain: {
enable: true,
},
failoverConfig: {
failoverHealthThreshold: 70,
},
labels: {
foo: "bar",
},
});
const defaultBackendService = new gcp.compute.BackendService("default", {
name: "my-lb-backend",
description: "my description",
loadBalancingScheme: "INTERNAL_SELF_MANAGED",
protocol: "HTTP",
serviceLbPolicy: pulumi.interpolate`//networkservices.googleapis.com/${_default.id}`,
});
import pulumi
import pulumi_gcp as gcp
default = gcp.networkservices.ServiceLbPolicies("default",
name="my-lb-policy",
location="global",
description="my description",
load_balancing_algorithm="SPRAY_TO_REGION",
auto_capacity_drain=gcp.networkservices.ServiceLbPoliciesAutoCapacityDrainArgs(
enable=True,
),
failover_config=gcp.networkservices.ServiceLbPoliciesFailoverConfigArgs(
failover_health_threshold=70,
),
labels={
"foo": "bar",
})
default_backend_service = gcp.compute.BackendService("default",
name="my-lb-backend",
description="my description",
load_balancing_scheme="INTERNAL_SELF_MANAGED",
protocol="HTTP",
service_lb_policy=default.id.apply(lambda id: f"//networkservices.googleapis.com/{id}"))
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networkservices.NewServiceLbPolicies(ctx, "default", &networkservices.ServiceLbPoliciesArgs{
Name: pulumi.String("my-lb-policy"),
Location: pulumi.String("global"),
Description: pulumi.String("my description"),
LoadBalancingAlgorithm: pulumi.String("SPRAY_TO_REGION"),
AutoCapacityDrain: &networkservices.ServiceLbPoliciesAutoCapacityDrainArgs{
Enable: pulumi.Bool(true),
},
FailoverConfig: &networkservices.ServiceLbPoliciesFailoverConfigArgs{
FailoverHealthThreshold: pulumi.Int(70),
},
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
})
if err != nil {
return err
}
_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("my-lb-backend"),
Description: pulumi.String("my description"),
LoadBalancingScheme: pulumi.String("INTERNAL_SELF_MANAGED"),
Protocol: pulumi.String("HTTP"),
ServiceLbPolicy: _default.ID().ApplyT(func(id string) (string, error) {
return fmt.Sprintf("//networkservices.googleapis.com/%v", id), nil
}).(pulumi.StringOutput),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.NetworkServices.ServiceLbPolicies("default", new()
{
Name = "my-lb-policy",
Location = "global",
Description = "my description",
LoadBalancingAlgorithm = "SPRAY_TO_REGION",
AutoCapacityDrain = new Gcp.NetworkServices.Inputs.ServiceLbPoliciesAutoCapacityDrainArgs
{
Enable = true,
},
FailoverConfig = new Gcp.NetworkServices.Inputs.ServiceLbPoliciesFailoverConfigArgs
{
FailoverHealthThreshold = 70,
},
Labels =
{
{ "foo", "bar" },
},
});
var defaultBackendService = new Gcp.Compute.BackendService("default", new()
{
Name = "my-lb-backend",
Description = "my description",
LoadBalancingScheme = "INTERNAL_SELF_MANAGED",
Protocol = "HTTP",
ServiceLbPolicy = @default.Id.Apply(id => $"//networkservices.googleapis.com/{id}"),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkservices.ServiceLbPolicies;
import com.pulumi.gcp.networkservices.ServiceLbPoliciesArgs;
import com.pulumi.gcp.networkservices.inputs.ServiceLbPoliciesAutoCapacityDrainArgs;
import com.pulumi.gcp.networkservices.inputs.ServiceLbPoliciesFailoverConfigArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
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 default_ = new ServiceLbPolicies("default", ServiceLbPoliciesArgs.builder()
.name("my-lb-policy")
.location("global")
.description("my description")
.loadBalancingAlgorithm("SPRAY_TO_REGION")
.autoCapacityDrain(ServiceLbPoliciesAutoCapacityDrainArgs.builder()
.enable(true)
.build())
.failoverConfig(ServiceLbPoliciesFailoverConfigArgs.builder()
.failoverHealthThreshold(70)
.build())
.labels(Map.of("foo", "bar"))
.build());
var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder()
.name("my-lb-backend")
.description("my description")
.loadBalancingScheme("INTERNAL_SELF_MANAGED")
.protocol("HTTP")
.serviceLbPolicy(default_.id().applyValue(id -> String.format("//networkservices.googleapis.com/%s", id)))
.build());
}
}
resources:
default:
type: gcp:networkservices:ServiceLbPolicies
properties:
name: my-lb-policy
location: global
description: my description
loadBalancingAlgorithm: SPRAY_TO_REGION
autoCapacityDrain:
enable: true
failoverConfig:
failoverHealthThreshold: 70
labels:
foo: bar
defaultBackendService:
type: gcp:compute:BackendService
name: default
properties:
name: my-lb-backend
description: my description
loadBalancingScheme: INTERNAL_SELF_MANAGED
protocol: HTTP
serviceLbPolicy: //networkservices.googleapis.com/${default.id}
Create ServiceLbPolicies Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceLbPolicies(name: string, args: ServiceLbPoliciesArgs, opts?: CustomResourceOptions);
@overload
def ServiceLbPolicies(resource_name: str,
args: ServiceLbPoliciesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceLbPolicies(resource_name: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
auto_capacity_drain: Optional[ServiceLbPoliciesAutoCapacityDrainArgs] = None,
description: Optional[str] = None,
failover_config: Optional[ServiceLbPoliciesFailoverConfigArgs] = None,
labels: Optional[Mapping[str, str]] = None,
load_balancing_algorithm: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None)
func NewServiceLbPolicies(ctx *Context, name string, args ServiceLbPoliciesArgs, opts ...ResourceOption) (*ServiceLbPolicies, error)
public ServiceLbPolicies(string name, ServiceLbPoliciesArgs args, CustomResourceOptions? opts = null)
public ServiceLbPolicies(String name, ServiceLbPoliciesArgs args)
public ServiceLbPolicies(String name, ServiceLbPoliciesArgs args, CustomResourceOptions options)
type: gcp:networkservices:ServiceLbPolicies
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ServiceLbPoliciesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServiceLbPoliciesArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServiceLbPoliciesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceLbPoliciesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceLbPoliciesArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var serviceLbPoliciesResource = new Gcp.NetworkServices.ServiceLbPolicies("serviceLbPoliciesResource", new()
{
Location = "string",
AutoCapacityDrain = new Gcp.NetworkServices.Inputs.ServiceLbPoliciesAutoCapacityDrainArgs
{
Enable = false,
},
Description = "string",
FailoverConfig = new Gcp.NetworkServices.Inputs.ServiceLbPoliciesFailoverConfigArgs
{
FailoverHealthThreshold = 0,
},
Labels =
{
{ "string", "string" },
},
LoadBalancingAlgorithm = "string",
Name = "string",
Project = "string",
});
example, err := networkservices.NewServiceLbPolicies(ctx, "serviceLbPoliciesResource", &networkservices.ServiceLbPoliciesArgs{
Location: pulumi.String("string"),
AutoCapacityDrain: &networkservices.ServiceLbPoliciesAutoCapacityDrainArgs{
Enable: pulumi.Bool(false),
},
Description: pulumi.String("string"),
FailoverConfig: &networkservices.ServiceLbPoliciesFailoverConfigArgs{
FailoverHealthThreshold: pulumi.Int(0),
},
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
LoadBalancingAlgorithm: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
})
var serviceLbPoliciesResource = new ServiceLbPolicies("serviceLbPoliciesResource", ServiceLbPoliciesArgs.builder()
.location("string")
.autoCapacityDrain(ServiceLbPoliciesAutoCapacityDrainArgs.builder()
.enable(false)
.build())
.description("string")
.failoverConfig(ServiceLbPoliciesFailoverConfigArgs.builder()
.failoverHealthThreshold(0)
.build())
.labels(Map.of("string", "string"))
.loadBalancingAlgorithm("string")
.name("string")
.project("string")
.build());
service_lb_policies_resource = gcp.networkservices.ServiceLbPolicies("serviceLbPoliciesResource",
location="string",
auto_capacity_drain=gcp.networkservices.ServiceLbPoliciesAutoCapacityDrainArgs(
enable=False,
),
description="string",
failover_config=gcp.networkservices.ServiceLbPoliciesFailoverConfigArgs(
failover_health_threshold=0,
),
labels={
"string": "string",
},
load_balancing_algorithm="string",
name="string",
project="string")
const serviceLbPoliciesResource = new gcp.networkservices.ServiceLbPolicies("serviceLbPoliciesResource", {
location: "string",
autoCapacityDrain: {
enable: false,
},
description: "string",
failoverConfig: {
failoverHealthThreshold: 0,
},
labels: {
string: "string",
},
loadBalancingAlgorithm: "string",
name: "string",
project: "string",
});
type: gcp:networkservices:ServiceLbPolicies
properties:
autoCapacityDrain:
enable: false
description: string
failoverConfig:
failoverHealthThreshold: 0
labels:
string: string
loadBalancingAlgorithm: string
location: string
name: string
project: string
ServiceLbPolicies Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ServiceLbPolicies resource accepts the following input properties:
- Location string
- The location of the service lb policy.
- Auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- Labels Dictionary<string, string>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - Name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Location string
- The location of the service lb policy.
- Auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain Args - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Failover
Config ServiceLb Policies Failover Config Args - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- Labels map[string]string
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - Name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location String
- The location of the service lb policy.
- auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- description String
- A free-text description of the resource. Max length 1024 characters.
- failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Map<String,String>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing StringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - name String
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location string
- The location of the service lb policy.
- auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- description string
- A free-text description of the resource. Max length 1024 characters.
- failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels {[key: string]: string}
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location str
- The location of the service lb policy.
- auto_
capacity_ Servicedrain Lb Policies Auto Capacity Drain Args - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- description str
- A free-text description of the resource. Max length 1024 characters.
- failover_
config ServiceLb Policies Failover Config Args - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Mapping[str, str]
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load_
balancing_ stralgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - name str
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- location String
- The location of the service lb policy.
- auto
Capacity Property MapDrain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- description String
- A free-text description of the resource. Max length 1024 characters.
- failover
Config Property Map - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Map<String>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing StringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - name String
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceLbPolicies resource produces the following output properties:
- Create
Time string - Time the ServiceLbPolicy was created in UTC.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Update
Time string - Time the ServiceLbPolicy was updated in UTC.
- Create
Time string - Time the ServiceLbPolicy was created in UTC.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Update
Time string - Time the ServiceLbPolicy was updated in UTC.
- create
Time String - Time the ServiceLbPolicy was created in UTC.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time String - Time the ServiceLbPolicy was updated in UTC.
- create
Time string - Time the ServiceLbPolicy was created in UTC.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id string
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time string - Time the ServiceLbPolicy was updated in UTC.
- create_
time str - Time the ServiceLbPolicy was created in UTC.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id str
- The provider-assigned unique ID for this managed resource.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- update_
time str - Time the ServiceLbPolicy was updated in UTC.
- create
Time String - Time the ServiceLbPolicy was created in UTC.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time String - Time the ServiceLbPolicy was updated in UTC.
Look up Existing ServiceLbPolicies Resource
Get an existing ServiceLbPolicies 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?: ServiceLbPoliciesState, opts?: CustomResourceOptions): ServiceLbPolicies
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_capacity_drain: Optional[ServiceLbPoliciesAutoCapacityDrainArgs] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
effective_labels: Optional[Mapping[str, str]] = None,
failover_config: Optional[ServiceLbPoliciesFailoverConfigArgs] = None,
labels: Optional[Mapping[str, str]] = None,
load_balancing_algorithm: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
update_time: Optional[str] = None) -> ServiceLbPolicies
func GetServiceLbPolicies(ctx *Context, name string, id IDInput, state *ServiceLbPoliciesState, opts ...ResourceOption) (*ServiceLbPolicies, error)
public static ServiceLbPolicies Get(string name, Input<string> id, ServiceLbPoliciesState? state, CustomResourceOptions? opts = null)
public static ServiceLbPolicies get(String name, Output<String> id, ServiceLbPoliciesState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- Create
Time string - Time the ServiceLbPolicy was created in UTC.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- Labels Dictionary<string, string>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - Location string
- The location of the service lb policy.
- Name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Update
Time string - Time the ServiceLbPolicy was updated in UTC.
- Auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain Args - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- Create
Time string - Time the ServiceLbPolicy was created in UTC.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Failover
Config ServiceLb Policies Failover Config Args - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- Labels map[string]string
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - Location string
- The location of the service lb policy.
- Name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Update
Time string - Time the ServiceLbPolicy was updated in UTC.
- auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- create
Time String - Time the ServiceLbPolicy was created in UTC.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Map<String,String>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing StringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - location String
- The location of the service lb policy.
- name String
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time String - Time the ServiceLbPolicy was updated in UTC.
- auto
Capacity ServiceDrain Lb Policies Auto Capacity Drain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- create
Time string - Time the ServiceLbPolicy was created in UTC.
- description string
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- failover
Config ServiceLb Policies Failover Config - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels {[key: string]: string}
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing stringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - location string
- The location of the service lb policy.
- name string
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time string - Time the ServiceLbPolicy was updated in UTC.
- auto_
capacity_ Servicedrain Lb Policies Auto Capacity Drain Args - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- create_
time str - Time the ServiceLbPolicy was created in UTC.
- description str
- A free-text description of the resource. Max length 1024 characters.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- failover_
config ServiceLb Policies Failover Config Args - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Mapping[str, str]
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load_
balancing_ stralgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - location str
- The location of the service lb policy.
- name str
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- update_
time str - Time the ServiceLbPolicy was updated in UTC.
- auto
Capacity Property MapDrain - Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. Structure is documented below.
- create
Time String - Time the ServiceLbPolicy was created in UTC.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- failover
Config Property Map - Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. Structure is documented below.
- labels Map<String>
- Set of label tags associated with the ServiceLbPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - load
Balancing StringAlgorithm - The type of load balancing algorithm to be used. The default behavior is WATERFALL_BY_REGION.
Possible values are:
SPRAY_TO_REGION
,SPRAY_TO_WORLD
,WATERFALL_BY_REGION
,WATERFALL_BY_ZONE
. - location String
- The location of the service lb policy.
- name String
- Name of the ServiceLbPolicy resource. It matches pattern
projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}
. - project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- update
Time String - Time the ServiceLbPolicy was updated in UTC.
Supporting Types
ServiceLbPoliciesAutoCapacityDrain, ServiceLbPoliciesAutoCapacityDrainArgs
- Enable bool
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
- Enable bool
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
- enable Boolean
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
- enable boolean
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
- enable bool
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
- enable Boolean
- Optional. If set to 'True', an unhealthy MIG/NEG will be set as drained. - An MIG/NEG is considered unhealthy if less than 25% of the instances/endpoints in the MIG/NEG are healthy. - This option will never result in draining more than 50% of the configured IGs/NEGs for the Backend Service.
ServiceLbPoliciesFailoverConfig, ServiceLbPoliciesFailoverConfigArgs
- Failover
Health intThreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
- Failover
Health intThreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
- failover
Health IntegerThreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
- failover
Health numberThreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
- failover_
health_ intthreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
- failover
Health NumberThreshold - Optional. The percentage threshold that a load balancer will begin to send traffic to failover backends. If the percentage of endpoints in a MIG/NEG is smaller than this value, traffic would be sent to failover backends if possible. This field should be set to a value between 1 and 99. The default value is 50 for Global external HTTP(S) load balancer (classic) and Proxyless service mesh, and 70 for others.
Import
ServiceLbPolicies can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/serviceLbPolicies/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
When using the pulumi import
command, ServiceLbPolicies can be imported using one of the formats above. For example:
$ pulumi import gcp:networkservices/serviceLbPolicies:ServiceLbPolicies default projects/{{project}}/locations/{{location}}/serviceLbPolicies/{{name}}
$ pulumi import gcp:networkservices/serviceLbPolicies:ServiceLbPolicies default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:networkservices/serviceLbPolicies:ServiceLbPolicies default {{location}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.