import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * ServiceLbPolicy holds global load balancing and traffic distribution configuration that can be applied to a BackendService. * * > **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. * See Provider Versions for more details on beta resources. * * To get more information about ServiceLbPolicies, see: * * * [API documentation](https://cloud.google.com/service-mesh/docs/reference/network-services/rest/v1/projects.locations.serviceLbPolicies) * * ## Example Usage * * ### Network Services Service Lb Policies Basic * * ```typescript * 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", * }); * ``` * ### Network Services Service Lb Policies Advanced * * ```typescript * 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}`, * }); * ``` * ### Network Services Service Lb Policies Beta * * ```typescript * 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, * }, * isolationConfig: { * isolationGranularity: "REGION", * isolationMode: "NEAREST", * }, * 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 * * 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: * * ```sh * $ 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}} * ``` */ export declare class ServiceLbPolicies extends pulumi.CustomResource { /** * Get an existing ServiceLbPolicies 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?: ServiceLbPoliciesState, opts?: pulumi.CustomResourceOptions): ServiceLbPolicies; /** * Returns true if the given object is an instance of ServiceLbPolicies. 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 ServiceLbPolicies; /** * Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. * Structure is documented below. */ readonly autoCapacityDrain: pulumi.Output; /** * Time the ServiceLbPolicy was created in UTC. */ readonly createTime: pulumi.Output; /** * A free-text description of the resource. Max length 1024 characters. */ readonly description: pulumi.Output; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. * Structure is documented below. */ readonly failoverConfig: pulumi.Output; /** * Configuration to provide isolation support for the associated Backend Service. * Structure is documented below. */ readonly isolationConfig: pulumi.Output; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * 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`. */ readonly loadBalancingAlgorithm: pulumi.Output; /** * The location of the service lb policy. */ readonly location: pulumi.Output; /** * Name of the ServiceLbPolicy resource. It matches pattern `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Time the ServiceLbPolicy was updated in UTC. */ readonly updateTime: pulumi.Output; /** * Create a ServiceLbPolicies 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: ServiceLbPoliciesArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceLbPolicies resources. */ export interface ServiceLbPoliciesState { /** * Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. * Structure is documented below. */ autoCapacityDrain?: pulumi.Input; /** * Time the ServiceLbPolicy was created in UTC. */ createTime?: pulumi.Input; /** * A free-text description of the resource. Max length 1024 characters. */ description?: pulumi.Input; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. * Structure is documented below. */ failoverConfig?: pulumi.Input; /** * Configuration to provide isolation support for the associated Backend Service. * Structure is documented below. */ isolationConfig?: pulumi.Input; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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`. */ loadBalancingAlgorithm?: pulumi.Input; /** * The location of the service lb policy. */ location?: pulumi.Input; /** * Name of the ServiceLbPolicy resource. It matches pattern `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * Time the ServiceLbPolicy was updated in UTC. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a ServiceLbPolicies resource. */ export interface ServiceLbPoliciesArgs { /** * Option to specify if an unhealthy MIG/NEG should be considered for global load balancing and traffic routing. * Structure is documented below. */ autoCapacityDrain?: pulumi.Input; /** * A free-text description of the resource. Max length 1024 characters. */ description?: pulumi.Input; /** * Option to specify health based failover behavior. This is not related to Network load balancer FailoverPolicy. * Structure is documented below. */ failoverConfig?: pulumi.Input; /** * Configuration to provide isolation support for the associated Backend Service. * Structure is documented below. */ isolationConfig?: pulumi.Input; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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`. */ loadBalancingAlgorithm?: pulumi.Input; /** * The location of the service lb policy. */ location: pulumi.Input; /** * Name of the ServiceLbPolicy resource. It matches pattern `projects/{project}/locations/{location}/serviceLbPolicies/{service_lb_policy_name}`. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; }