gcorelabs.Lbmember
Explore with Pulumi AI
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
- Pool
Id string - Protocol
Port double - Instance
Id string - Last
Updated string - Lbmember
Id string - The ID of this resource.
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Subnet
Id string - Timeouts
Lbmember
Timeouts - Weight double
- Value between 0 and 256
- Address string
- Pool
Id string - Protocol
Port float64 - Instance
Id string - Last
Updated string - Lbmember
Id string - The ID of this resource.
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Subnet
Id string - Timeouts
Lbmember
Timeouts Args - Weight float64
- Value between 0 and 256
- address String
- pool
Id String - protocol
Port Double - instance
Id String - last
Updated String - lbmember
Id String - The ID of this resource.
- project
Id Double - project
Name String - region
Id Double - region
Name String - subnet
Id String - timeouts
Lbmember
Timeouts - weight Double
- Value between 0 and 256
- address string
- pool
Id string - protocol
Port number - instance
Id string - last
Updated string - lbmember
Id string - The ID of this resource.
- project
Id number - project
Name string - region
Id number - region
Name string - subnet
Id string - timeouts
Lbmember
Timeouts - 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
Lbmember
Timeouts Args - weight float
- Value between 0 and 256
- address String
- pool
Id String - protocol
Port Number - instance
Id String - last
Updated String - lbmember
Id String - The ID of this resource.
- project
Id Number - project
Name String - region
Id Number - region
Name String - subnet
Id 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.
- Operating
Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Operating
Status string
- id String
- The provider-assigned unique ID for this managed resource.
- operating
Status String
- id string
- The provider-assigned unique ID for this managed resource.
- operating
Status 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.
- operating
Status 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.
- Address string
- Instance
Id string - Last
Updated string - Lbmember
Id string - The ID of this resource.
- Operating
Status string - Pool
Id string - Project
Id double - Project
Name string - Protocol
Port double - Region
Id double - Region
Name string - Subnet
Id string - Timeouts
Lbmember
Timeouts - Weight double
- Value between 0 and 256
- Address string
- Instance
Id string - Last
Updated string - Lbmember
Id string - The ID of this resource.
- Operating
Status string - Pool
Id string - Project
Id float64 - Project
Name string - Protocol
Port float64 - Region
Id float64 - Region
Name string - Subnet
Id string - Timeouts
Lbmember
Timeouts Args - Weight float64
- Value between 0 and 256
- address String
- instance
Id String - last
Updated String - lbmember
Id String - The ID of this resource.
- operating
Status String - pool
Id String - project
Id Double - project
Name String - protocol
Port Double - region
Id Double - region
Name String - subnet
Id String - timeouts
Lbmember
Timeouts - weight Double
- Value between 0 and 256
- address string
- instance
Id string - last
Updated string - lbmember
Id string - The ID of this resource.
- operating
Status string - pool
Id string - project
Id number - project
Name string - protocol
Port number - region
Id number - region
Name string - subnet
Id string - timeouts
Lbmember
Timeouts - 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
Lbmember
Timeouts Args - weight float
- Value between 0 and 256
- address String
- instance
Id String - last
Updated String - lbmember
Id String - The ID of this resource.
- operating
Status String - pool
Id String - project
Id Number - project
Name String - protocol
Port Number - region
Id Number - region
Name String - subnet
Id String - timeouts Property Map
- weight Number
- Value between 0 and 256
Supporting Types
LbmemberTimeouts, LbmemberTimeoutsArgs
Import
import using <project_id>:<region_id>:
$ 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.