1. Packages
  2. Ibm Provider
  3. API Docs
  4. LbServiceGroup
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.LbServiceGroup

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, and delete a local load balancer service group.

    Note

    For more information, see the IBM Cloud Classic Infrastructure (SoftLayer) API docs.

    Example Usage

    In the following example, you can create a local load balancer service group:

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testServiceGroup = new ibm.LbServiceGroup("testServiceGroup", {
        port: 82,
        routingMethod: "CONSISTENT_HASH_IP",
        routingType: "HTTP",
        loadBalancerId: ibm_lb.test_lb_local.id,
        allocation: 100,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    test_service_group = ibm.LbServiceGroup("testServiceGroup",
        port=82,
        routing_method="CONSISTENT_HASH_IP",
        routing_type="HTTP",
        load_balancer_id=ibm_lb["test_lb_local"]["id"],
        allocation=100)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewLbServiceGroup(ctx, "testServiceGroup", &ibm.LbServiceGroupArgs{
    			Port:           pulumi.Float64(82),
    			RoutingMethod:  pulumi.String("CONSISTENT_HASH_IP"),
    			RoutingType:    pulumi.String("HTTP"),
    			LoadBalancerId: pulumi.Any(ibm_lb.Test_lb_local.Id),
    			Allocation:     pulumi.Float64(100),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var testServiceGroup = new Ibm.LbServiceGroup("testServiceGroup", new()
        {
            Port = 82,
            RoutingMethod = "CONSISTENT_HASH_IP",
            RoutingType = "HTTP",
            LoadBalancerId = ibm_lb.Test_lb_local.Id,
            Allocation = 100,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.LbServiceGroup;
    import com.pulumi.ibm.LbServiceGroupArgs;
    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 testServiceGroup = new LbServiceGroup("testServiceGroup", LbServiceGroupArgs.builder()
                .port(82)
                .routingMethod("CONSISTENT_HASH_IP")
                .routingType("HTTP")
                .loadBalancerId(ibm_lb.test_lb_local().id())
                .allocation(100)
                .build());
    
        }
    }
    
    resources:
      testServiceGroup:
        type: ibm:LbServiceGroup
        properties:
          port: 82
          routingMethod: CONSISTENT_HASH_IP
          routingType: HTTP
          loadBalancerId: ${ibm_lb.test_lb_local.id}
          allocation: 100
    

    Argument reference

    Review the argument references that you can specify for your resource.

    • allocation - (Required, Integer) The connection allocation for the load balancer service group.
    • load_balancer_id - (Required, Forces new resource,Integer) The ID of the local load balancer.
    • port - (Required, Integer) The port for the local load balancer service group.
    • routing_method - (Required, String) The routing method for the load balancer group. For example, CONSISTENT_HASH_IP.
    • routing_type- (Required, String) The routing type for the group.
    • timeout- (Optional, Integer) The timeout value for connections from remote clients to the load balancer. Timeout values are only valid for HTTP service groups.
    • tags- (Optional, Array of Strings) Tags associated with the local load balancer service group instance. Note Tags are managed locally and not stored on the IBM Cloud Service Endpoint at this moment.

    Create LbServiceGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new LbServiceGroup(name: string, args: LbServiceGroupArgs, opts?: CustomResourceOptions);
    @overload
    def LbServiceGroup(resource_name: str,
                       args: LbServiceGroupArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def LbServiceGroup(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       allocation: Optional[float] = None,
                       load_balancer_id: Optional[float] = None,
                       port: Optional[float] = None,
                       routing_method: Optional[str] = None,
                       routing_type: Optional[str] = None,
                       lb_service_group_id: Optional[str] = None,
                       tags: Optional[Sequence[str]] = None,
                       timeout: Optional[float] = None)
    func NewLbServiceGroup(ctx *Context, name string, args LbServiceGroupArgs, opts ...ResourceOption) (*LbServiceGroup, error)
    public LbServiceGroup(string name, LbServiceGroupArgs args, CustomResourceOptions? opts = null)
    public LbServiceGroup(String name, LbServiceGroupArgs args)
    public LbServiceGroup(String name, LbServiceGroupArgs args, CustomResourceOptions options)
    
    type: ibm:LbServiceGroup
    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 LbServiceGroupArgs
    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 LbServiceGroupArgs
    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 LbServiceGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LbServiceGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LbServiceGroupArgs
    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 lbServiceGroupResource = new Ibm.LbServiceGroup("lbServiceGroupResource", new()
    {
        Allocation = 0,
        LoadBalancerId = 0,
        Port = 0,
        RoutingMethod = "string",
        RoutingType = "string",
        LbServiceGroupId = "string",
        Tags = new[]
        {
            "string",
        },
        Timeout = 0,
    });
    
    example, err := ibm.NewLbServiceGroup(ctx, "lbServiceGroupResource", &ibm.LbServiceGroupArgs{
    	Allocation:       pulumi.Float64(0),
    	LoadBalancerId:   pulumi.Float64(0),
    	Port:             pulumi.Float64(0),
    	RoutingMethod:    pulumi.String("string"),
    	RoutingType:      pulumi.String("string"),
    	LbServiceGroupId: pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Timeout: pulumi.Float64(0),
    })
    
    var lbServiceGroupResource = new LbServiceGroup("lbServiceGroupResource", LbServiceGroupArgs.builder()
        .allocation(0)
        .loadBalancerId(0)
        .port(0)
        .routingMethod("string")
        .routingType("string")
        .lbServiceGroupId("string")
        .tags("string")
        .timeout(0)
        .build());
    
    lb_service_group_resource = ibm.LbServiceGroup("lbServiceGroupResource",
        allocation=0,
        load_balancer_id=0,
        port=0,
        routing_method="string",
        routing_type="string",
        lb_service_group_id="string",
        tags=["string"],
        timeout=0)
    
    const lbServiceGroupResource = new ibm.LbServiceGroup("lbServiceGroupResource", {
        allocation: 0,
        loadBalancerId: 0,
        port: 0,
        routingMethod: "string",
        routingType: "string",
        lbServiceGroupId: "string",
        tags: ["string"],
        timeout: 0,
    });
    
    type: ibm:LbServiceGroup
    properties:
        allocation: 0
        lbServiceGroupId: string
        loadBalancerId: 0
        port: 0
        routingMethod: string
        routingType: string
        tags:
            - string
        timeout: 0
    

    LbServiceGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The LbServiceGroup resource accepts the following input properties:

    Allocation double
    Allocation type
    LoadBalancerId double
    Loadbalancer ID
    Port double
    Port number
    RoutingMethod string
    Routing method
    RoutingType string
    Routing type
    LbServiceGroupId string
    Tags List<string>
    List of tags
    Timeout double
    Timeout value
    Allocation float64
    Allocation type
    LoadBalancerId float64
    Loadbalancer ID
    Port float64
    Port number
    RoutingMethod string
    Routing method
    RoutingType string
    Routing type
    LbServiceGroupId string
    Tags []string
    List of tags
    Timeout float64
    Timeout value
    allocation Double
    Allocation type
    loadBalancerId Double
    Loadbalancer ID
    port Double
    Port number
    routingMethod String
    Routing method
    routingType String
    Routing type
    lbServiceGroupId String
    tags List<String>
    List of tags
    timeout Double
    Timeout value
    allocation number
    Allocation type
    loadBalancerId number
    Loadbalancer ID
    port number
    Port number
    routingMethod string
    Routing method
    routingType string
    Routing type
    lbServiceGroupId string
    tags string[]
    List of tags
    timeout number
    Timeout value
    allocation float
    Allocation type
    load_balancer_id float
    Loadbalancer ID
    port float
    Port number
    routing_method str
    Routing method
    routing_type str
    Routing type
    lb_service_group_id str
    tags Sequence[str]
    List of tags
    timeout float
    Timeout value
    allocation Number
    Allocation type
    loadBalancerId Number
    Loadbalancer ID
    port Number
    Port number
    routingMethod String
    Routing method
    routingType String
    Routing type
    lbServiceGroupId String
    tags List<String>
    List of tags
    timeout Number
    Timeout value

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LbServiceGroup resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceGroupId double
    (String) The unique identifier of the load balancer service group.
    VirtualServerId double
    (String) The unique identifier of the virtual server.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceGroupId float64
    (String) The unique identifier of the load balancer service group.
    VirtualServerId float64
    (String) The unique identifier of the virtual server.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceGroupId Double
    (String) The unique identifier of the load balancer service group.
    virtualServerId Double
    (String) The unique identifier of the virtual server.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceGroupId number
    (String) The unique identifier of the load balancer service group.
    virtualServerId number
    (String) The unique identifier of the virtual server.
    id str
    The provider-assigned unique ID for this managed resource.
    service_group_id float
    (String) The unique identifier of the load balancer service group.
    virtual_server_id float
    (String) The unique identifier of the virtual server.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceGroupId Number
    (String) The unique identifier of the load balancer service group.
    virtualServerId Number
    (String) The unique identifier of the virtual server.

    Look up Existing LbServiceGroup Resource

    Get an existing LbServiceGroup 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?: LbServiceGroupState, opts?: CustomResourceOptions): LbServiceGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allocation: Optional[float] = None,
            lb_service_group_id: Optional[str] = None,
            load_balancer_id: Optional[float] = None,
            port: Optional[float] = None,
            routing_method: Optional[str] = None,
            routing_type: Optional[str] = None,
            service_group_id: Optional[float] = None,
            tags: Optional[Sequence[str]] = None,
            timeout: Optional[float] = None,
            virtual_server_id: Optional[float] = None) -> LbServiceGroup
    func GetLbServiceGroup(ctx *Context, name string, id IDInput, state *LbServiceGroupState, opts ...ResourceOption) (*LbServiceGroup, error)
    public static LbServiceGroup Get(string name, Input<string> id, LbServiceGroupState? state, CustomResourceOptions? opts = null)
    public static LbServiceGroup get(String name, Output<String> id, LbServiceGroupState state, CustomResourceOptions options)
    resources:  _:    type: ibm:LbServiceGroup    get:      id: ${id}
    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.
    The following state arguments are supported:
    Allocation double
    Allocation type
    LbServiceGroupId string
    LoadBalancerId double
    Loadbalancer ID
    Port double
    Port number
    RoutingMethod string
    Routing method
    RoutingType string
    Routing type
    ServiceGroupId double
    (String) The unique identifier of the load balancer service group.
    Tags List<string>
    List of tags
    Timeout double
    Timeout value
    VirtualServerId double
    (String) The unique identifier of the virtual server.
    Allocation float64
    Allocation type
    LbServiceGroupId string
    LoadBalancerId float64
    Loadbalancer ID
    Port float64
    Port number
    RoutingMethod string
    Routing method
    RoutingType string
    Routing type
    ServiceGroupId float64
    (String) The unique identifier of the load balancer service group.
    Tags []string
    List of tags
    Timeout float64
    Timeout value
    VirtualServerId float64
    (String) The unique identifier of the virtual server.
    allocation Double
    Allocation type
    lbServiceGroupId String
    loadBalancerId Double
    Loadbalancer ID
    port Double
    Port number
    routingMethod String
    Routing method
    routingType String
    Routing type
    serviceGroupId Double
    (String) The unique identifier of the load balancer service group.
    tags List<String>
    List of tags
    timeout Double
    Timeout value
    virtualServerId Double
    (String) The unique identifier of the virtual server.
    allocation number
    Allocation type
    lbServiceGroupId string
    loadBalancerId number
    Loadbalancer ID
    port number
    Port number
    routingMethod string
    Routing method
    routingType string
    Routing type
    serviceGroupId number
    (String) The unique identifier of the load balancer service group.
    tags string[]
    List of tags
    timeout number
    Timeout value
    virtualServerId number
    (String) The unique identifier of the virtual server.
    allocation float
    Allocation type
    lb_service_group_id str
    load_balancer_id float
    Loadbalancer ID
    port float
    Port number
    routing_method str
    Routing method
    routing_type str
    Routing type
    service_group_id float
    (String) The unique identifier of the load balancer service group.
    tags Sequence[str]
    List of tags
    timeout float
    Timeout value
    virtual_server_id float
    (String) The unique identifier of the virtual server.
    allocation Number
    Allocation type
    lbServiceGroupId String
    loadBalancerId Number
    Loadbalancer ID
    port Number
    Port number
    routingMethod String
    Routing method
    routingType String
    Routing type
    serviceGroupId Number
    (String) The unique identifier of the load balancer service group.
    tags List<String>
    List of tags
    timeout Number
    Timeout value
    virtualServerId Number
    (String) The unique identifier of the virtual server.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud