1. Packages
  2. Lxd Provider
  3. API Docs
  4. NetworkLb
lxd 2.5.0 published on Thursday, Mar 13, 2025 by terraform-lxd

lxd.NetworkLb

Explore with Pulumi AI

Create NetworkLb Resource

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

Constructor syntax

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

@overload
def NetworkLb(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              listen_address: Optional[str] = None,
              network: Optional[str] = None,
              backends: Optional[Sequence[NetworkLbBackendArgs]] = None,
              config: Optional[Mapping[str, str]] = None,
              description: Optional[str] = None,
              ports: Optional[Sequence[NetworkLbPortArgs]] = None,
              project: Optional[str] = None,
              remote: Optional[str] = None)
func NewNetworkLb(ctx *Context, name string, args NetworkLbArgs, opts ...ResourceOption) (*NetworkLb, error)
public NetworkLb(string name, NetworkLbArgs args, CustomResourceOptions? opts = null)
public NetworkLb(String name, NetworkLbArgs args)
public NetworkLb(String name, NetworkLbArgs args, CustomResourceOptions options)
type: lxd:NetworkLb
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 This property is required. NetworkLbArgs
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 This property is required. NetworkLbArgs
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 This property is required. NetworkLbArgs
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 This property is required. NetworkLbArgs
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. NetworkLbArgs
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 networkLbResource = new Lxd.NetworkLb("networkLbResource", new()
{
    ListenAddress = "string",
    Network = "string",
    Backends = new[]
    {
        new Lxd.Inputs.NetworkLbBackendArgs
        {
            Name = "string",
            TargetAddress = "string",
            Description = "string",
            TargetPort = "string",
        },
    },
    Config = 
    {
        { "string", "string" },
    },
    Description = "string",
    Ports = new[]
    {
        new Lxd.Inputs.NetworkLbPortArgs
        {
            ListenPort = "string",
            TargetBackends = new[]
            {
                "string",
            },
            Description = "string",
            Protocol = "string",
        },
    },
    Project = "string",
    Remote = "string",
});
Copy
example, err := lxd.NewNetworkLb(ctx, "networkLbResource", &lxd.NetworkLbArgs{
ListenAddress: pulumi.String("string"),
Network: pulumi.String("string"),
Backends: .NetworkLbBackendArray{
&.NetworkLbBackendArgs{
Name: pulumi.String("string"),
TargetAddress: pulumi.String("string"),
Description: pulumi.String("string"),
TargetPort: pulumi.String("string"),
},
},
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Ports: .NetworkLbPortArray{
&.NetworkLbPortArgs{
ListenPort: pulumi.String("string"),
TargetBackends: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
Project: pulumi.String("string"),
Remote: pulumi.String("string"),
})
Copy
var networkLbResource = new NetworkLb("networkLbResource", NetworkLbArgs.builder()
    .listenAddress("string")
    .network("string")
    .backends(NetworkLbBackendArgs.builder()
        .name("string")
        .targetAddress("string")
        .description("string")
        .targetPort("string")
        .build())
    .config(Map.of("string", "string"))
    .description("string")
    .ports(NetworkLbPortArgs.builder()
        .listenPort("string")
        .targetBackends("string")
        .description("string")
        .protocol("string")
        .build())
    .project("string")
    .remote("string")
    .build());
Copy
network_lb_resource = lxd.NetworkLb("networkLbResource",
    listen_address="string",
    network="string",
    backends=[{
        "name": "string",
        "target_address": "string",
        "description": "string",
        "target_port": "string",
    }],
    config={
        "string": "string",
    },
    description="string",
    ports=[{
        "listen_port": "string",
        "target_backends": ["string"],
        "description": "string",
        "protocol": "string",
    }],
    project="string",
    remote="string")
Copy
const networkLbResource = new lxd.NetworkLb("networkLbResource", {
    listenAddress: "string",
    network: "string",
    backends: [{
        name: "string",
        targetAddress: "string",
        description: "string",
        targetPort: "string",
    }],
    config: {
        string: "string",
    },
    description: "string",
    ports: [{
        listenPort: "string",
        targetBackends: ["string"],
        description: "string",
        protocol: "string",
    }],
    project: "string",
    remote: "string",
});
Copy
type: lxd:NetworkLb
properties:
    backends:
        - description: string
          name: string
          targetAddress: string
          targetPort: string
    config:
        string: string
    description: string
    listenAddress: string
    network: string
    ports:
        - description: string
          listenPort: string
          protocol: string
          targetBackends:
            - string
    project: string
    remote: string
Copy

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

ListenAddress This property is required. string
Network This property is required. string
Backends List<NetworkLbBackend>
Network load balancer backend
Config Dictionary<string, string>
Description string
Ports List<NetworkLbPort>
Network load balancer port
Project string
Remote string
ListenAddress This property is required. string
Network This property is required. string
Backends []NetworkLbBackendArgs
Network load balancer backend
Config map[string]string
Description string
Ports []NetworkLbPortArgs
Network load balancer port
Project string
Remote string
listenAddress This property is required. String
network This property is required. String
backends List<NetworkLbBackend>
Network load balancer backend
config Map<String,String>
description String
ports List<NetworkLbPort>
Network load balancer port
project String
remote String
listenAddress This property is required. string
network This property is required. string
backends NetworkLbBackend[]
Network load balancer backend
config {[key: string]: string}
description string
ports NetworkLbPort[]
Network load balancer port
project string
remote string
listen_address This property is required. str
network This property is required. str
backends Sequence[NetworkLbBackendArgs]
Network load balancer backend
config Mapping[str, str]
description str
ports Sequence[NetworkLbPortArgs]
Network load balancer port
project str
remote str
listenAddress This property is required. String
network This property is required. String
backends List<Property Map>
Network load balancer backend
config Map<String>
description String
ports List<Property Map>
Network load balancer port
project String
remote String

Outputs

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

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

Look up Existing NetworkLb Resource

Get an existing NetworkLb 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?: NetworkLbState, opts?: CustomResourceOptions): NetworkLb
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backends: Optional[Sequence[NetworkLbBackendArgs]] = None,
        config: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        listen_address: Optional[str] = None,
        network: Optional[str] = None,
        ports: Optional[Sequence[NetworkLbPortArgs]] = None,
        project: Optional[str] = None,
        remote: Optional[str] = None) -> NetworkLb
func GetNetworkLb(ctx *Context, name string, id IDInput, state *NetworkLbState, opts ...ResourceOption) (*NetworkLb, error)
public static NetworkLb Get(string name, Input<string> id, NetworkLbState? state, CustomResourceOptions? opts = null)
public static NetworkLb get(String name, Output<String> id, NetworkLbState state, CustomResourceOptions options)
resources:  _:    type: lxd:NetworkLb    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:
Backends List<NetworkLbBackend>
Network load balancer backend
Config Dictionary<string, string>
Description string
ListenAddress string
Network string
Ports List<NetworkLbPort>
Network load balancer port
Project string
Remote string
Backends []NetworkLbBackendArgs
Network load balancer backend
Config map[string]string
Description string
ListenAddress string
Network string
Ports []NetworkLbPortArgs
Network load balancer port
Project string
Remote string
backends List<NetworkLbBackend>
Network load balancer backend
config Map<String,String>
description String
listenAddress String
network String
ports List<NetworkLbPort>
Network load balancer port
project String
remote String
backends NetworkLbBackend[]
Network load balancer backend
config {[key: string]: string}
description string
listenAddress string
network string
ports NetworkLbPort[]
Network load balancer port
project string
remote string
backends Sequence[NetworkLbBackendArgs]
Network load balancer backend
config Mapping[str, str]
description str
listen_address str
network str
ports Sequence[NetworkLbPortArgs]
Network load balancer port
project str
remote str
backends List<Property Map>
Network load balancer backend
config Map<String>
description String
listenAddress String
network String
ports List<Property Map>
Network load balancer port
project String
remote String

Supporting Types

NetworkLbBackend
, NetworkLbBackendArgs

Name This property is required. string
LB backend name
TargetAddress This property is required. string
LB backend target address
Description string
LB backend description
TargetPort string
LB backend target port
Name This property is required. string
LB backend name
TargetAddress This property is required. string
LB backend target address
Description string
LB backend description
TargetPort string
LB backend target port
name This property is required. String
LB backend name
targetAddress This property is required. String
LB backend target address
description String
LB backend description
targetPort String
LB backend target port
name This property is required. string
LB backend name
targetAddress This property is required. string
LB backend target address
description string
LB backend description
targetPort string
LB backend target port
name This property is required. str
LB backend name
target_address This property is required. str
LB backend target address
description str
LB backend description
target_port str
LB backend target port
name This property is required. String
LB backend name
targetAddress This property is required. String
LB backend target address
description String
LB backend description
targetPort String
LB backend target port

NetworkLbPort
, NetworkLbPortArgs

ListenPort This property is required. string
Port to listen to
TargetBackends This property is required. List<string>
List of target LB backends
Description string
Port description
Protocol string
Port protocol
ListenPort This property is required. string
Port to listen to
TargetBackends This property is required. []string
List of target LB backends
Description string
Port description
Protocol string
Port protocol
listenPort This property is required. String
Port to listen to
targetBackends This property is required. List<String>
List of target LB backends
description String
Port description
protocol String
Port protocol
listenPort This property is required. string
Port to listen to
targetBackends This property is required. string[]
List of target LB backends
description string
Port description
protocol string
Port protocol
listen_port This property is required. str
Port to listen to
target_backends This property is required. Sequence[str]
List of target LB backends
description str
Port description
protocol str
Port protocol
listenPort This property is required. String
Port to listen to
targetBackends This property is required. List<String>
List of target LB backends
description String
Port description
protocol String
Port protocol

Package Details

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