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

lxd.NetworkForward

Explore with Pulumi AI

Create NetworkForward Resource

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

Constructor syntax

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

@overload
def NetworkForward(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   listen_address: Optional[str] = None,
                   network: Optional[str] = None,
                   config: Optional[Mapping[str, str]] = None,
                   description: Optional[str] = None,
                   ports: Optional[Sequence[NetworkForwardPortArgs]] = None,
                   project: Optional[str] = None,
                   remote: Optional[str] = None)
func NewNetworkForward(ctx *Context, name string, args NetworkForwardArgs, opts ...ResourceOption) (*NetworkForward, error)
public NetworkForward(string name, NetworkForwardArgs args, CustomResourceOptions? opts = null)
public NetworkForward(String name, NetworkForwardArgs args)
public NetworkForward(String name, NetworkForwardArgs args, CustomResourceOptions options)
type: lxd:NetworkForward
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. NetworkForwardArgs
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. NetworkForwardArgs
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. NetworkForwardArgs
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. NetworkForwardArgs
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. NetworkForwardArgs
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 networkForwardResource = new Lxd.NetworkForward("networkForwardResource", new()
{
    ListenAddress = "string",
    Network = "string",
    Config = 
    {
        { "string", "string" },
    },
    Description = "string",
    Ports = new[]
    {
        new Lxd.Inputs.NetworkForwardPortArgs
        {
            ListenPort = "string",
            Protocol = "string",
            TargetAddress = "string",
            Description = "string",
            TargetPort = "string",
        },
    },
    Project = "string",
    Remote = "string",
});
Copy
example, err := lxd.NewNetworkForward(ctx, "networkForwardResource", &lxd.NetworkForwardArgs{
ListenAddress: pulumi.String("string"),
Network: pulumi.String("string"),
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Ports: .NetworkForwardPortArray{
&.NetworkForwardPortArgs{
ListenPort: pulumi.String("string"),
Protocol: pulumi.String("string"),
TargetAddress: pulumi.String("string"),
Description: pulumi.String("string"),
TargetPort: pulumi.String("string"),
},
},
Project: pulumi.String("string"),
Remote: pulumi.String("string"),
})
Copy
var networkForwardResource = new NetworkForward("networkForwardResource", NetworkForwardArgs.builder()
    .listenAddress("string")
    .network("string")
    .config(Map.of("string", "string"))
    .description("string")
    .ports(NetworkForwardPortArgs.builder()
        .listenPort("string")
        .protocol("string")
        .targetAddress("string")
        .description("string")
        .targetPort("string")
        .build())
    .project("string")
    .remote("string")
    .build());
Copy
network_forward_resource = lxd.NetworkForward("networkForwardResource",
    listen_address="string",
    network="string",
    config={
        "string": "string",
    },
    description="string",
    ports=[{
        "listen_port": "string",
        "protocol": "string",
        "target_address": "string",
        "description": "string",
        "target_port": "string",
    }],
    project="string",
    remote="string")
Copy
const networkForwardResource = new lxd.NetworkForward("networkForwardResource", {
    listenAddress: "string",
    network: "string",
    config: {
        string: "string",
    },
    description: "string",
    ports: [{
        listenPort: "string",
        protocol: "string",
        targetAddress: "string",
        description: "string",
        targetPort: "string",
    }],
    project: "string",
    remote: "string",
});
Copy
type: lxd:NetworkForward
properties:
    config:
        string: string
    description: string
    listenAddress: string
    network: string
    ports:
        - description: string
          listenPort: string
          protocol: string
          targetAddress: string
          targetPort: string
    project: string
    remote: string
Copy

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

ListenAddress This property is required. string
Required - IP address to listen on.
Network This property is required. string
Required - Name of the network.
Config Dictionary<string, string>
Optional - Map of key/value pairs of network forward config settings.
Description string
Optional - Description of port(s)
Ports List<NetworkForwardPort>
Optional - List of port specifications. See reference below.
Project string
Optional - Name of the project where the network forward will be created.
Remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

ListenAddress This property is required. string
Required - IP address to listen on.
Network This property is required. string
Required - Name of the network.
Config map[string]string
Optional - Map of key/value pairs of network forward config settings.
Description string
Optional - Description of port(s)
Ports []NetworkForwardPortArgs
Optional - List of port specifications. See reference below.
Project string
Optional - Name of the project where the network forward will be created.
Remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

listenAddress This property is required. String
Required - IP address to listen on.
network This property is required. String
Required - Name of the network.
config Map<String,String>
Optional - Map of key/value pairs of network forward config settings.
description String
Optional - Description of port(s)
ports List<NetworkForwardPort>
Optional - List of port specifications. See reference below.
project String
Optional - Name of the project where the network forward will be created.
remote String

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

listenAddress This property is required. string
Required - IP address to listen on.
network This property is required. string
Required - Name of the network.
config {[key: string]: string}
Optional - Map of key/value pairs of network forward config settings.
description string
Optional - Description of port(s)
ports NetworkForwardPort[]
Optional - List of port specifications. See reference below.
project string
Optional - Name of the project where the network forward will be created.
remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

listen_address This property is required. str
Required - IP address to listen on.
network This property is required. str
Required - Name of the network.
config Mapping[str, str]
Optional - Map of key/value pairs of network forward config settings.
description str
Optional - Description of port(s)
ports Sequence[NetworkForwardPortArgs]
Optional - List of port specifications. See reference below.
project str
Optional - Name of the project where the network forward will be created.
remote str

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

listenAddress This property is required. String
Required - IP address to listen on.
network This property is required. String
Required - Name of the network.
config Map<String>
Optional - Map of key/value pairs of network forward config settings.
description String
Optional - Description of port(s)
ports List<Property Map>
Optional - List of port specifications. See reference below.
project String
Optional - Name of the project where the network forward will be created.
remote String

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkForward 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 NetworkForward Resource

Get an existing NetworkForward 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?: NetworkForwardState, opts?: CustomResourceOptions): NetworkForward
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        listen_address: Optional[str] = None,
        network: Optional[str] = None,
        ports: Optional[Sequence[NetworkForwardPortArgs]] = None,
        project: Optional[str] = None,
        remote: Optional[str] = None) -> NetworkForward
func GetNetworkForward(ctx *Context, name string, id IDInput, state *NetworkForwardState, opts ...ResourceOption) (*NetworkForward, error)
public static NetworkForward Get(string name, Input<string> id, NetworkForwardState? state, CustomResourceOptions? opts = null)
public static NetworkForward get(String name, Output<String> id, NetworkForwardState state, CustomResourceOptions options)
resources:  _:    type: lxd:NetworkForward    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:
Config Dictionary<string, string>
Optional - Map of key/value pairs of network forward config settings.
Description string
Optional - Description of port(s)
ListenAddress string
Required - IP address to listen on.
Network string
Required - Name of the network.
Ports List<NetworkForwardPort>
Optional - List of port specifications. See reference below.
Project string
Optional - Name of the project where the network forward will be created.
Remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

Config map[string]string
Optional - Map of key/value pairs of network forward config settings.
Description string
Optional - Description of port(s)
ListenAddress string
Required - IP address to listen on.
Network string
Required - Name of the network.
Ports []NetworkForwardPortArgs
Optional - List of port specifications. See reference below.
Project string
Optional - Name of the project where the network forward will be created.
Remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

config Map<String,String>
Optional - Map of key/value pairs of network forward config settings.
description String
Optional - Description of port(s)
listenAddress String
Required - IP address to listen on.
network String
Required - Name of the network.
ports List<NetworkForwardPort>
Optional - List of port specifications. See reference below.
project String
Optional - Name of the project where the network forward will be created.
remote String

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

config {[key: string]: string}
Optional - Map of key/value pairs of network forward config settings.
description string
Optional - Description of port(s)
listenAddress string
Required - IP address to listen on.
network string
Required - Name of the network.
ports NetworkForwardPort[]
Optional - List of port specifications. See reference below.
project string
Optional - Name of the project where the network forward will be created.
remote string

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

config Mapping[str, str]
Optional - Map of key/value pairs of network forward config settings.
description str
Optional - Description of port(s)
listen_address str
Required - IP address to listen on.
network str
Required - Name of the network.
ports Sequence[NetworkForwardPortArgs]
Optional - List of port specifications. See reference below.
project str
Optional - Name of the project where the network forward will be created.
remote str

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

config Map<String>
Optional - Map of key/value pairs of network forward config settings.
description String
Optional - Description of port(s)
listenAddress String
Required - IP address to listen on.
network String
Required - Name of the network.
ports List<Property Map>
Optional - List of port specifications. See reference below.
project String
Optional - Name of the project where the network forward will be created.
remote String

Optional - The remote in which the resource will be created. If not provided, the provider's default remote will be used.

The network forward port supports:

Supporting Types

NetworkForwardPort
, NetworkForwardPortArgs

ListenPort This property is required. string
Required - Listen port(s) (e.g. 80,90-100)
Protocol This property is required. string
Required - Protocol for the port(s). Possible values are tcp and udp.
TargetAddress This property is required. string
Required - IP address to forward to
Description string
Optional - Description of port(s)
TargetPort string
Optional - Target port(s) (e.g. 70,80-90 or 90).
ListenPort This property is required. string
Required - Listen port(s) (e.g. 80,90-100)
Protocol This property is required. string
Required - Protocol for the port(s). Possible values are tcp and udp.
TargetAddress This property is required. string
Required - IP address to forward to
Description string
Optional - Description of port(s)
TargetPort string
Optional - Target port(s) (e.g. 70,80-90 or 90).
listenPort This property is required. String
Required - Listen port(s) (e.g. 80,90-100)
protocol This property is required. String
Required - Protocol for the port(s). Possible values are tcp and udp.
targetAddress This property is required. String
Required - IP address to forward to
description String
Optional - Description of port(s)
targetPort String
Optional - Target port(s) (e.g. 70,80-90 or 90).
listenPort This property is required. string
Required - Listen port(s) (e.g. 80,90-100)
protocol This property is required. string
Required - Protocol for the port(s). Possible values are tcp and udp.
targetAddress This property is required. string
Required - IP address to forward to
description string
Optional - Description of port(s)
targetPort string
Optional - Target port(s) (e.g. 70,80-90 or 90).
listen_port This property is required. str
Required - Listen port(s) (e.g. 80,90-100)
protocol This property is required. str
Required - Protocol for the port(s). Possible values are tcp and udp.
target_address This property is required. str
Required - IP address to forward to
description str
Optional - Description of port(s)
target_port str
Optional - Target port(s) (e.g. 70,80-90 or 90).
listenPort This property is required. String
Required - Listen port(s) (e.g. 80,90-100)
protocol This property is required. String
Required - Protocol for the port(s). Possible values are tcp and udp.
targetAddress This property is required. String
Required - IP address to forward to
description String
Optional - Description of port(s)
targetPort String
Optional - Target port(s) (e.g. 70,80-90 or 90).

Package Details

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