1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. Lbmember
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.Lbmember

Explore with Pulumi AI

gcorelabs logo
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

    Represent load balancer member

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const lb = new gcore.index.Gcore_loadbalancer("lb", {
        projectId: 1,
        regionId: 1,
        name: "test1",
        flavor: "lb1-1-2",
        listeners: [{
            name: "test",
            protocol: "HTTP",
            protocolPort: 80,
        }],
    });
    const pl = new gcore.index.Gcore_lbpool("pl", {
        projectId: 1,
        regionId: 1,
        name: "test_pool1",
        protocol: "HTTP",
        lbAlgorithm: "LEAST_CONNECTIONS",
        loadbalancerId: lb.id,
        listenerId: lb.listeners[0].id,
        healthMonitor: [{
            type: "PING",
            delay: 60,
            maxRetries: 5,
            timeout: 10,
        }],
        sessionPersistence: [{
            type: "APP_COOKIE",
            cookieName: "test_new_cookie",
        }],
    });
    const lbm = new gcore.index.Gcore_lbmember("lbm", {
        projectId: 1,
        regionId: 1,
        poolId: pl.id,
        address: "10.10.2.15",
        protocolPort: 8081,
        weight: 5,
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    lb = gcore.index.Gcore_loadbalancer("lb",
        project_id=1,
        region_id=1,
        name=test1,
        flavor=lb1-1-2,
        listeners=[{
            name: test,
            protocol: HTTP,
            protocolPort: 80,
        }])
    pl = gcore.index.Gcore_lbpool("pl",
        project_id=1,
        region_id=1,
        name=test_pool1,
        protocol=HTTP,
        lb_algorithm=LEAST_CONNECTIONS,
        loadbalancer_id=lb.id,
        listener_id=lb.listeners[0].id,
        health_monitor=[{
            type: PING,
            delay: 60,
            maxRetries: 5,
            timeout: 10,
        }],
        session_persistence=[{
            type: APP_COOKIE,
            cookieName: test_new_cookie,
        }])
    lbm = gcore.index.Gcore_lbmember("lbm",
        project_id=1,
        region_id=1,
        pool_id=pl.id,
        address=10.10.2.15,
        protocol_port=8081,
        weight=5)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcore/sdk/go/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		lb, err := gcore.NewGcore_loadbalancer(ctx, "lb", &gcore.Gcore_loadbalancerArgs{
    			ProjectId: 1,
    			RegionId:  1,
    			Name:      "test1",
    			Flavor:    "lb1-1-2",
    			Listeners: []map[string]interface{}{
    				map[string]interface{}{
    					"name":         "test",
    					"protocol":     "HTTP",
    					"protocolPort": 80,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		pl, err := gcore.NewGcore_lbpool(ctx, "pl", &gcore.Gcore_lbpoolArgs{
    			ProjectId:      1,
    			RegionId:       1,
    			Name:           "test_pool1",
    			Protocol:       "HTTP",
    			LbAlgorithm:    "LEAST_CONNECTIONS",
    			LoadbalancerId: lb.Id,
    			ListenerId:     lb.Listeners[0].Id,
    			HealthMonitor: []map[string]interface{}{
    				map[string]interface{}{
    					"type":       "PING",
    					"delay":      60,
    					"maxRetries": 5,
    					"timeout":    10,
    				},
    			},
    			SessionPersistence: []map[string]interface{}{
    				map[string]interface{}{
    					"type":       "APP_COOKIE",
    					"cookieName": "test_new_cookie",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewGcore_lbmember(ctx, "lbm", &gcore.Gcore_lbmemberArgs{
    			ProjectId:    1,
    			RegionId:     1,
    			PoolId:       pl.Id,
    			Address:      "10.10.2.15",
    			ProtocolPort: 8081,
    			Weight:       5,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var lb = new Gcore.Index.Gcore_loadbalancer("lb", new()
        {
            ProjectId = 1,
            RegionId = 1,
            Name = "test1",
            Flavor = "lb1-1-2",
            Listeners = new[]
            {
                
                {
                    { "name", "test" },
                    { "protocol", "HTTP" },
                    { "protocolPort", 80 },
                },
            },
        });
    
        var pl = new Gcore.Index.Gcore_lbpool("pl", new()
        {
            ProjectId = 1,
            RegionId = 1,
            Name = "test_pool1",
            Protocol = "HTTP",
            LbAlgorithm = "LEAST_CONNECTIONS",
            LoadbalancerId = lb.Id,
            ListenerId = lb.Listeners[0].Id,
            HealthMonitor = new[]
            {
                
                {
                    { "type", "PING" },
                    { "delay", 60 },
                    { "maxRetries", 5 },
                    { "timeout", 10 },
                },
            },
            SessionPersistence = new[]
            {
                
                {
                    { "type", "APP_COOKIE" },
                    { "cookieName", "test_new_cookie" },
                },
            },
        });
    
        var lbm = new Gcore.Index.Gcore_lbmember("lbm", new()
        {
            ProjectId = 1,
            RegionId = 1,
            PoolId = pl.Id,
            Address = "10.10.2.15",
            ProtocolPort = 8081,
            Weight = 5,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.gcore_loadbalancer;
    import com.pulumi.gcore.Gcore_loadbalancerArgs;
    import com.pulumi.gcore.gcore_lbpool;
    import com.pulumi.gcore.Gcore_lbpoolArgs;
    import com.pulumi.gcore.gcore_lbmember;
    import com.pulumi.gcore.Gcore_lbmemberArgs;
    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 lb = new Gcore_loadbalancer("lb", Gcore_loadbalancerArgs.builder()
                .projectId(1)
                .regionId(1)
                .name("test1")
                .flavor("lb1-1-2")
                .listeners(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build());
    
            var pl = new Gcore_lbpool("pl", Gcore_lbpoolArgs.builder()
                .projectId(1)
                .regionId(1)
                .name("test_pool1")
                .protocol("HTTP")
                .lbAlgorithm("LEAST_CONNECTIONS")
                .loadbalancerId(lb.id())
                .listenerId(lb.listeners()[0].id())
                .healthMonitor(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .sessionPersistence(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build());
    
            var lbm = new Gcore_lbmember("lbm", Gcore_lbmemberArgs.builder()
                .projectId(1)
                .regionId(1)
                .poolId(pl.id())
                .address("10.10.2.15")
                .protocolPort(8081)
                .weight(5)
                .build());
    
        }
    }
    
    resources:
      lb:
        type: gcore:gcore_loadbalancer
        properties:
          projectId: 1
          regionId: 1
          name: test1
          flavor: lb1-1-2
          listeners:
            - name: test
              protocol: HTTP
              protocolPort: 80
      pl:
        type: gcore:gcore_lbpool
        properties:
          projectId: 1
          regionId: 1
          name: test_pool1
          protocol: HTTP
          lbAlgorithm: LEAST_CONNECTIONS
          loadbalancerId: ${lb.id}
          listenerId: ${lb.listeners[0].id}
          healthMonitor:
            - type: PING
              delay: 60
              maxRetries: 5
              timeout: 10
          sessionPersistence:
            - type: APP_COOKIE
              cookieName: test_new_cookie
      lbm:
        type: gcore:gcore_lbmember
        properties:
          projectId: 1
          regionId: 1
          poolId: ${pl.id}
          address: 10.10.2.15
          protocolPort: 8081
          weight: 5
    

    Create Lbmember Resource

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

    Constructor syntax

    new Lbmember(name: string, args: LbmemberArgs, opts?: CustomResourceOptions);
    @overload
    def Lbmember(resource_name: str,
                 args: LbmemberArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Lbmember(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 pool_id: Optional[str] = None,
                 protocol_port: Optional[float] = None,
                 address: Optional[str] = None,
                 project_name: Optional[str] = None,
                 lbmember_id: Optional[str] = None,
                 project_id: Optional[float] = None,
                 last_updated: Optional[str] = None,
                 instance_id: Optional[str] = None,
                 region_id: Optional[float] = None,
                 region_name: Optional[str] = None,
                 subnet_id: Optional[str] = None,
                 timeouts: Optional[LbmemberTimeoutsArgs] = None,
                 weight: Optional[float] = None)
    func NewLbmember(ctx *Context, name string, args LbmemberArgs, opts ...ResourceOption) (*Lbmember, error)
    public Lbmember(string name, LbmemberArgs args, CustomResourceOptions? opts = null)
    public Lbmember(String name, LbmemberArgs args)
    public Lbmember(String name, LbmemberArgs args, CustomResourceOptions options)
    
    type: gcorelabs:Lbmember
    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 LbmemberArgs
    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 LbmemberArgs
    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 LbmemberArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LbmemberArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LbmemberArgs
    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 lbmemberResource = new Gcorelabs.Lbmember("lbmemberResource", new()
    {
        PoolId = "string",
        ProtocolPort = 0,
        Address = "string",
        ProjectName = "string",
        LbmemberId = "string",
        ProjectId = 0,
        LastUpdated = "string",
        InstanceId = "string",
        RegionId = 0,
        RegionName = "string",
        SubnetId = "string",
        Timeouts = new Gcorelabs.Inputs.LbmemberTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
        Weight = 0,
    });
    
    example, err := gcorelabs.NewLbmember(ctx, "lbmemberResource", &gcorelabs.LbmemberArgs{
    	PoolId:       pulumi.String("string"),
    	ProtocolPort: pulumi.Float64(0),
    	Address:      pulumi.String("string"),
    	ProjectName:  pulumi.String("string"),
    	LbmemberId:   pulumi.String("string"),
    	ProjectId:    pulumi.Float64(0),
    	LastUpdated:  pulumi.String("string"),
    	InstanceId:   pulumi.String("string"),
    	RegionId:     pulumi.Float64(0),
    	RegionName:   pulumi.String("string"),
    	SubnetId:     pulumi.String("string"),
    	Timeouts: &gcorelabs.LbmemberTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    	Weight: pulumi.Float64(0),
    })
    
    var lbmemberResource = new Lbmember("lbmemberResource", LbmemberArgs.builder()
        .poolId("string")
        .protocolPort(0)
        .address("string")
        .projectName("string")
        .lbmemberId("string")
        .projectId(0)
        .lastUpdated("string")
        .instanceId("string")
        .regionId(0)
        .regionName("string")
        .subnetId("string")
        .timeouts(LbmemberTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .weight(0)
        .build());
    
    lbmember_resource = gcorelabs.Lbmember("lbmemberResource",
        pool_id="string",
        protocol_port=0,
        address="string",
        project_name="string",
        lbmember_id="string",
        project_id=0,
        last_updated="string",
        instance_id="string",
        region_id=0,
        region_name="string",
        subnet_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        },
        weight=0)
    
    const lbmemberResource = new gcorelabs.Lbmember("lbmemberResource", {
        poolId: "string",
        protocolPort: 0,
        address: "string",
        projectName: "string",
        lbmemberId: "string",
        projectId: 0,
        lastUpdated: "string",
        instanceId: "string",
        regionId: 0,
        regionName: "string",
        subnetId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
        weight: 0,
    });
    
    type: gcorelabs:Lbmember
    properties:
        address: string
        instanceId: string
        lastUpdated: string
        lbmemberId: string
        poolId: string
        projectId: 0
        projectName: string
        protocolPort: 0
        regionId: 0
        regionName: string
        subnetId: string
        timeouts:
            create: string
            delete: string
        weight: 0
    

    Lbmember 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 Lbmember resource accepts the following input properties:

    Address string
    PoolId string
    ProtocolPort double
    InstanceId string
    LastUpdated string
    LbmemberId string
    The ID of this resource.
    ProjectId double
    ProjectName string
    RegionId double
    RegionName string
    SubnetId string
    Timeouts LbmemberTimeouts
    Weight double
    Value between 0 and 256
    Address string
    PoolId string
    ProtocolPort float64
    InstanceId string
    LastUpdated string
    LbmemberId string
    The ID of this resource.
    ProjectId float64
    ProjectName string
    RegionId float64
    RegionName string
    SubnetId string
    Timeouts LbmemberTimeoutsArgs
    Weight float64
    Value between 0 and 256
    address String
    poolId String
    protocolPort Double
    instanceId String
    lastUpdated String
    lbmemberId String
    The ID of this resource.
    projectId Double
    projectName String
    regionId Double
    regionName String
    subnetId String
    timeouts LbmemberTimeouts
    weight Double
    Value between 0 and 256
    address string
    poolId string
    protocolPort number
    instanceId string
    lastUpdated string
    lbmemberId string
    The ID of this resource.
    projectId number
    projectName string
    regionId number
    regionName string
    subnetId string
    timeouts LbmemberTimeouts
    weight number
    Value between 0 and 256
    address str
    pool_id str
    protocol_port float
    instance_id str
    last_updated str
    lbmember_id str
    The ID of this resource.
    project_id float
    project_name str
    region_id float
    region_name str
    subnet_id str
    timeouts LbmemberTimeoutsArgs
    weight float
    Value between 0 and 256
    address String
    poolId String
    protocolPort Number
    instanceId String
    lastUpdated String
    lbmemberId String
    The ID of this resource.
    projectId Number
    projectName String
    regionId Number
    regionName String
    subnetId String
    timeouts Property Map
    weight Number
    Value between 0 and 256

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    OperatingStatus string
    Id string
    The provider-assigned unique ID for this managed resource.
    OperatingStatus string
    id String
    The provider-assigned unique ID for this managed resource.
    operatingStatus String
    id string
    The provider-assigned unique ID for this managed resource.
    operatingStatus string
    id str
    The provider-assigned unique ID for this managed resource.
    operating_status str
    id String
    The provider-assigned unique ID for this managed resource.
    operatingStatus String

    Look up Existing Lbmember Resource

    Get an existing Lbmember 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?: LbmemberState, opts?: CustomResourceOptions): Lbmember
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            address: Optional[str] = None,
            instance_id: Optional[str] = None,
            last_updated: Optional[str] = None,
            lbmember_id: Optional[str] = None,
            operating_status: Optional[str] = None,
            pool_id: Optional[str] = None,
            project_id: Optional[float] = None,
            project_name: Optional[str] = None,
            protocol_port: Optional[float] = None,
            region_id: Optional[float] = None,
            region_name: Optional[str] = None,
            subnet_id: Optional[str] = None,
            timeouts: Optional[LbmemberTimeoutsArgs] = None,
            weight: Optional[float] = None) -> Lbmember
    func GetLbmember(ctx *Context, name string, id IDInput, state *LbmemberState, opts ...ResourceOption) (*Lbmember, error)
    public static Lbmember Get(string name, Input<string> id, LbmemberState? state, CustomResourceOptions? opts = null)
    public static Lbmember get(String name, Output<String> id, LbmemberState state, CustomResourceOptions options)
    resources:  _:    type: gcorelabs:Lbmember    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:
    Address string
    InstanceId string
    LastUpdated string
    LbmemberId string
    The ID of this resource.
    OperatingStatus string
    PoolId string
    ProjectId double
    ProjectName string
    ProtocolPort double
    RegionId double
    RegionName string
    SubnetId string
    Timeouts LbmemberTimeouts
    Weight double
    Value between 0 and 256
    Address string
    InstanceId string
    LastUpdated string
    LbmemberId string
    The ID of this resource.
    OperatingStatus string
    PoolId string
    ProjectId float64
    ProjectName string
    ProtocolPort float64
    RegionId float64
    RegionName string
    SubnetId string
    Timeouts LbmemberTimeoutsArgs
    Weight float64
    Value between 0 and 256
    address String
    instanceId String
    lastUpdated String
    lbmemberId String
    The ID of this resource.
    operatingStatus String
    poolId String
    projectId Double
    projectName String
    protocolPort Double
    regionId Double
    regionName String
    subnetId String
    timeouts LbmemberTimeouts
    weight Double
    Value between 0 and 256
    address string
    instanceId string
    lastUpdated string
    lbmemberId string
    The ID of this resource.
    operatingStatus string
    poolId string
    projectId number
    projectName string
    protocolPort number
    regionId number
    regionName string
    subnetId string
    timeouts LbmemberTimeouts
    weight number
    Value between 0 and 256
    address str
    instance_id str
    last_updated str
    lbmember_id str
    The ID of this resource.
    operating_status str
    pool_id str
    project_id float
    project_name str
    protocol_port float
    region_id float
    region_name str
    subnet_id str
    timeouts LbmemberTimeoutsArgs
    weight float
    Value between 0 and 256
    address String
    instanceId String
    lastUpdated String
    lbmemberId String
    The ID of this resource.
    operatingStatus String
    poolId String
    projectId Number
    projectName String
    protocolPort Number
    regionId Number
    regionName String
    subnetId String
    timeouts Property Map
    weight Number
    Value between 0 and 256

    Supporting Types

    LbmemberTimeouts, LbmemberTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    import using <project_id>:<region_id>::<pool_id> format

    $ pulumi import gcorelabs:index/lbmember:Lbmember lbmember1 1:6:a775dd94-4e9c-4da7-9f0e-ffc9ae34446b:447d2959-8ae0-4ca0-8d47-9f050a3637d7
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    gcorelabs g-core/terraform-provider-gcorelabs
    License
    Notes
    This Pulumi package is based on the gcorelabs Terraform Provider.
    gcorelabs logo
    gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core