1. Packages
  2. Ucloud Provider
  3. API Docs
  4. Lb
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.Lb

Explore with Pulumi AI

Provides a Load Balancer resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";

const web = new ucloud.Lb("web", {tag: "tf-example"});
Copy
import pulumi
import pulumi_ucloud as ucloud

web = ucloud.Lb("web", tag="tf-example")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ucloud.NewLb(ctx, "web", &ucloud.LbArgs{
			Tag: pulumi.String("tf-example"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;

return await Deployment.RunAsync(() => 
{
    var web = new Ucloud.Lb("web", new()
    {
        Tag = "tf-example",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.Lb;
import com.pulumi.ucloud.LbArgs;
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 web = new Lb("web", LbArgs.builder()
            .tag("tf-example")
            .build());

    }
}
Copy
resources:
  web:
    type: ucloud:Lb
    properties:
      tag: tf-example
Copy

Create Lb Resource

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

Constructor syntax

new Lb(name: string, args?: LbArgs, opts?: CustomResourceOptions);
@overload
def Lb(resource_name: str,
       args: Optional[LbArgs] = None,
       opts: Optional[ResourceOptions] = None)

@overload
def Lb(resource_name: str,
       opts: Optional[ResourceOptions] = None,
       charge_type: Optional[str] = None,
       internal: Optional[bool] = None,
       lb_id: Optional[str] = None,
       listen_type: Optional[str] = None,
       name: Optional[str] = None,
       remark: Optional[str] = None,
       security_group: Optional[str] = None,
       subnet_id: Optional[str] = None,
       tag: Optional[str] = None,
       vpc_id: Optional[str] = None)
func NewLb(ctx *Context, name string, args *LbArgs, opts ...ResourceOption) (*Lb, error)
public Lb(string name, LbArgs? args = null, CustomResourceOptions? opts = null)
public Lb(String name, LbArgs args)
public Lb(String name, LbArgs args, CustomResourceOptions options)
type: ucloud:Lb
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args LbArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args LbArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args LbArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args LbArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LbArgs
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 lbResource = new Ucloud.Lb("lbResource", new()
{
    ChargeType = "string",
    Internal = false,
    LbId = "string",
    ListenType = "string",
    Name = "string",
    Remark = "string",
    SecurityGroup = "string",
    SubnetId = "string",
    Tag = "string",
    VpcId = "string",
});
Copy
example, err := ucloud.NewLb(ctx, "lbResource", &ucloud.LbArgs{
	ChargeType:    pulumi.String("string"),
	Internal:      pulumi.Bool(false),
	LbId:          pulumi.String("string"),
	ListenType:    pulumi.String("string"),
	Name:          pulumi.String("string"),
	Remark:        pulumi.String("string"),
	SecurityGroup: pulumi.String("string"),
	SubnetId:      pulumi.String("string"),
	Tag:           pulumi.String("string"),
	VpcId:         pulumi.String("string"),
})
Copy
var lbResource = new Lb("lbResource", LbArgs.builder()
    .chargeType("string")
    .internal(false)
    .lbId("string")
    .listenType("string")
    .name("string")
    .remark("string")
    .securityGroup("string")
    .subnetId("string")
    .tag("string")
    .vpcId("string")
    .build());
Copy
lb_resource = ucloud.Lb("lbResource",
    charge_type="string",
    internal=False,
    lb_id="string",
    listen_type="string",
    name="string",
    remark="string",
    security_group="string",
    subnet_id="string",
    tag="string",
    vpc_id="string")
Copy
const lbResource = new ucloud.Lb("lbResource", {
    chargeType: "string",
    internal: false,
    lbId: "string",
    listenType: "string",
    name: "string",
    remark: "string",
    securityGroup: "string",
    subnetId: "string",
    tag: "string",
    vpcId: "string",
});
Copy
type: ucloud:Lb
properties:
    chargeType: string
    internal: false
    lbId: string
    listenType: string
    name: string
    remark: string
    securityGroup: string
    subnetId: string
    tag: string
    vpcId: string
Copy

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

ChargeType string
, argument charge_type is deprecated for optimizing parameters.
Internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
LbId string
The ID of the resource load balancer.
ListenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
Name string
Remark string
The remarks of the load balancer. (Default: "").
SecurityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
SubnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
Tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
VpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
ChargeType string
, argument charge_type is deprecated for optimizing parameters.
Internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
LbId string
The ID of the resource load balancer.
ListenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
Name string
Remark string
The remarks of the load balancer. (Default: "").
SecurityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
SubnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
Tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
VpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType String
, argument charge_type is deprecated for optimizing parameters.
internal Boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
lbId String
The ID of the resource load balancer.
listenType String
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name String
remark String
The remarks of the load balancer. (Default: "").
securityGroup String
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId String
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag String
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId String
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType string
, argument charge_type is deprecated for optimizing parameters.
internal boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
lbId string
The ID of the resource load balancer.
listenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name string
remark string
The remarks of the load balancer. (Default: "").
securityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
charge_type str
, argument charge_type is deprecated for optimizing parameters.
internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
lb_id str
The ID of the resource load balancer.
listen_type str
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name str
remark str
The remarks of the load balancer. (Default: "").
security_group str
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnet_id str
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag str
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpc_id str
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType String
, argument charge_type is deprecated for optimizing parameters.
internal Boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
lbId String
The ID of the resource load balancer.
listenType String
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name String
remark String
The remarks of the load balancer. (Default: "").
securityGroup String
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId String
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag String
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId String
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.

Outputs

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

CreateTime string
The time of creation for load balancer, formatted in RFC3339 time string.
ExpireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
Id string
The provider-assigned unique ID for this managed resource.
IpSets List<LbIpSet>
It is a nested type which documented below.
PrivateIp string
The IP address of intranet IP. It is "" if internal is false.
CreateTime string
The time of creation for load balancer, formatted in RFC3339 time string.
ExpireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
Id string
The provider-assigned unique ID for this managed resource.
IpSets []LbIpSet
It is a nested type which documented below.
PrivateIp string
The IP address of intranet IP. It is "" if internal is false.
createTime String
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime String
Deprecated attribute expire_time is deprecated for optimizing outputs.
id String
The provider-assigned unique ID for this managed resource.
ipSets List<LbIpSet>
It is a nested type which documented below.
privateIp String
The IP address of intranet IP. It is "" if internal is false.
createTime string
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
id string
The provider-assigned unique ID for this managed resource.
ipSets LbIpSet[]
It is a nested type which documented below.
privateIp string
The IP address of intranet IP. It is "" if internal is false.
create_time str
The time of creation for load balancer, formatted in RFC3339 time string.
expire_time str
Deprecated attribute expire_time is deprecated for optimizing outputs.
id str
The provider-assigned unique ID for this managed resource.
ip_sets Sequence[LbIpSet]
It is a nested type which documented below.
private_ip str
The IP address of intranet IP. It is "" if internal is false.
createTime String
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime String
Deprecated attribute expire_time is deprecated for optimizing outputs.
id String
The provider-assigned unique ID for this managed resource.
ipSets List<Property Map>
It is a nested type which documented below.
privateIp String
The IP address of intranet IP. It is "" if internal is false.

Look up Existing Lb Resource

Get an existing Lb 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?: LbState, opts?: CustomResourceOptions): Lb
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        charge_type: Optional[str] = None,
        create_time: Optional[str] = None,
        expire_time: Optional[str] = None,
        internal: Optional[bool] = None,
        ip_sets: Optional[Sequence[LbIpSetArgs]] = None,
        lb_id: Optional[str] = None,
        listen_type: Optional[str] = None,
        name: Optional[str] = None,
        private_ip: Optional[str] = None,
        remark: Optional[str] = None,
        security_group: Optional[str] = None,
        subnet_id: Optional[str] = None,
        tag: Optional[str] = None,
        vpc_id: Optional[str] = None) -> Lb
func GetLb(ctx *Context, name string, id IDInput, state *LbState, opts ...ResourceOption) (*Lb, error)
public static Lb Get(string name, Input<string> id, LbState? state, CustomResourceOptions? opts = null)
public static Lb get(String name, Output<String> id, LbState state, CustomResourceOptions options)
resources:  _:    type: ucloud:Lb    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ChargeType string
, argument charge_type is deprecated for optimizing parameters.
CreateTime string
The time of creation for load balancer, formatted in RFC3339 time string.
ExpireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
Internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
IpSets List<LbIpSet>
It is a nested type which documented below.
LbId string
The ID of the resource load balancer.
ListenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
Name string
PrivateIp string
The IP address of intranet IP. It is "" if internal is false.
Remark string
The remarks of the load balancer. (Default: "").
SecurityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
SubnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
Tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
VpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
ChargeType string
, argument charge_type is deprecated for optimizing parameters.
CreateTime string
The time of creation for load balancer, formatted in RFC3339 time string.
ExpireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
Internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
IpSets []LbIpSetArgs
It is a nested type which documented below.
LbId string
The ID of the resource load balancer.
ListenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
Name string
PrivateIp string
The IP address of intranet IP. It is "" if internal is false.
Remark string
The remarks of the load balancer. (Default: "").
SecurityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
SubnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
Tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
VpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType String
, argument charge_type is deprecated for optimizing parameters.
createTime String
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime String
Deprecated attribute expire_time is deprecated for optimizing outputs.
internal Boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
ipSets List<LbIpSet>
It is a nested type which documented below.
lbId String
The ID of the resource load balancer.
listenType String
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name String
privateIp String
The IP address of intranet IP. It is "" if internal is false.
remark String
The remarks of the load balancer. (Default: "").
securityGroup String
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId String
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag String
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId String
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType string
, argument charge_type is deprecated for optimizing parameters.
createTime string
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime string
Deprecated attribute expire_time is deprecated for optimizing outputs.
internal boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
ipSets LbIpSet[]
It is a nested type which documented below.
lbId string
The ID of the resource load balancer.
listenType string
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name string
privateIp string
The IP address of intranet IP. It is "" if internal is false.
remark string
The remarks of the load balancer. (Default: "").
securityGroup string
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId string
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag string
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId string
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
charge_type str
, argument charge_type is deprecated for optimizing parameters.
create_time str
The time of creation for load balancer, formatted in RFC3339 time string.
expire_time str
Deprecated attribute expire_time is deprecated for optimizing outputs.
internal bool
Indicate whether the load balancer is intranet mode. (Default: "false")
ip_sets Sequence[LbIpSetArgs]
It is a nested type which documented below.
lb_id str
The ID of the resource load balancer.
listen_type str
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name str
private_ip str
The IP address of intranet IP. It is "" if internal is false.
remark str
The remarks of the load balancer. (Default: "").
security_group str
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnet_id str
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag str
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpc_id str
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.
chargeType String
, argument charge_type is deprecated for optimizing parameters.
createTime String
The time of creation for load balancer, formatted in RFC3339 time string.
expireTime String
Deprecated attribute expire_time is deprecated for optimizing outputs.
internal Boolean
Indicate whether the load balancer is intranet mode. (Default: "false")
ipSets List<Property Map>
It is a nested type which documented below.
lbId String
The ID of the resource load balancer.
listenType String
The type of listener. Possible values are request_proxy and packets_transmit. When packets_transmit was specified, you need to config the instances by yourself if the instances attach to the load balancer. You may refer to configuration instruction.
name String
privateIp String
The IP address of intranet IP. It is "" if internal is false.
remark String
The remarks of the load balancer. (Default: "").
securityGroup String
The ID of the associated security group. The security_group only takes effect for ULB instances of request_proxy mode and extranet mode at present.
subnetId String
The ID of subnet that intranet load balancer belongs to. This argument is not required if default subnet.
tag String
A tag assigned to load balancer, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default: Default).
vpcId String
The ID of the VPC linked to the Load balancer, This argument is not required if default VPC.

Supporting Types

LbIpSet
, LbIpSetArgs

InternetType This property is required. string
Type of Elastic IP routes.
Ip This property is required. string
Elastic IP address.
InternetType This property is required. string
Type of Elastic IP routes.
Ip This property is required. string
Elastic IP address.
internetType This property is required. String
Type of Elastic IP routes.
ip This property is required. String
Elastic IP address.
internetType This property is required. string
Type of Elastic IP routes.
ip This property is required. string
Elastic IP address.
internet_type This property is required. str
Type of Elastic IP routes.
ip This property is required. str
Elastic IP address.
internetType This property is required. String
Type of Elastic IP routes.
ip This property is required. String
Elastic IP address.

Import

LB can be imported using the id, e.g.

$ pulumi import ucloud:index/lb:Lb example ulb-abc123456
Copy

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

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.