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

lxd.Network

Explore with Pulumi AI

Create Network Resource

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

Constructor syntax

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

@overload
def Network(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[Mapping[str, str]] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            remote: Optional[str] = None,
            target: Optional[str] = None,
            type: Optional[str] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: lxd:Network
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 NetworkArgs
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 NetworkArgs
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 NetworkArgs
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 NetworkArgs
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. NetworkArgs
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 networkResource = new Lxd.Network("networkResource", new()
{
    Config = 
    {
        { "string", "string" },
    },
    Description = "string",
    Name = "string",
    Project = "string",
    Remote = "string",
    Target = "string",
    Type = "string",
});
Copy
example, err := lxd.NewNetwork(ctx, "networkResource", &lxd.NetworkArgs{
Config: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
Remote: pulumi.String("string"),
Target: pulumi.String("string"),
Type: pulumi.String("string"),
})
Copy
var networkResource = new Network("networkResource", NetworkArgs.builder()
    .config(Map.of("string", "string"))
    .description("string")
    .name("string")
    .project("string")
    .remote("string")
    .target("string")
    .type("string")
    .build());
Copy
network_resource = lxd.Network("networkResource",
    config={
        "string": "string",
    },
    description="string",
    name="string",
    project="string",
    remote="string",
    target="string",
    type="string")
Copy
const networkResource = new lxd.Network("networkResource", {
    config: {
        string: "string",
    },
    description: "string",
    name: "string",
    project: "string",
    remote: "string",
    target: "string",
    type: "string",
});
Copy
type: lxd:Network
properties:
    config:
        string: string
    description: string
    name: string
    project: string
    remote: string
    target: string
    type: string
Copy

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

Config Dictionary<string, string>
Optional - Map of key/value pairs of network config settings.
Description string
Optional - Description of the network.
Name string
Required - Name of the network. This is usually the device the network will appear as to instances.
Project string
Optional - Name of the project where the network 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.
Target string
Optional - Specify a target node in a cluster.
Type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
Config map[string]string
Optional - Map of key/value pairs of network config settings.
Description string
Optional - Description of the network.
Name string
Required - Name of the network. This is usually the device the network will appear as to instances.
Project string
Optional - Name of the project where the network 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.
Target string
Optional - Specify a target node in a cluster.
Type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Map<String,String>
Optional - Map of key/value pairs of network config settings.
description String
Optional - Description of the network.
name String
Required - Name of the network. This is usually the device the network will appear as to instances.
project String
Optional - Name of the project where the network 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.
target String
Optional - Specify a target node in a cluster.
type String
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config {[key: string]: string}
Optional - Map of key/value pairs of network config settings.
description string
Optional - Description of the network.
name string
Required - Name of the network. This is usually the device the network will appear as to instances.
project string
Optional - Name of the project where the network 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.
target string
Optional - Specify a target node in a cluster.
type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Mapping[str, str]
Optional - Map of key/value pairs of network config settings.
description str
Optional - Description of the network.
name str
Required - Name of the network. This is usually the device the network will appear as to instances.
project str
Optional - Name of the project where the network 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.
target str
Optional - Specify a target node in a cluster.
type str
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Map<String>
Optional - Map of key/value pairs of network config settings.
description String
Optional - Description of the network.
name String
Required - Name of the network. This is usually the device the network will appear as to instances.
project String
Optional - Name of the project where the network 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.
target String
Optional - Specify a target node in a cluster.
type String
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Managed bool
Whether or not the network is managed.
Id string
The provider-assigned unique ID for this managed resource.
Managed bool
Whether or not the network is managed.
id String
The provider-assigned unique ID for this managed resource.
managed Boolean
Whether or not the network is managed.
id string
The provider-assigned unique ID for this managed resource.
managed boolean
Whether or not the network is managed.
id str
The provider-assigned unique ID for this managed resource.
managed bool
Whether or not the network is managed.
id String
The provider-assigned unique ID for this managed resource.
managed Boolean
Whether or not the network is managed.

Look up Existing Network Resource

Get an existing Network 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?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config: Optional[Mapping[str, str]] = None,
        description: Optional[str] = None,
        managed: Optional[bool] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        remote: Optional[str] = None,
        target: Optional[str] = None,
        type: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
resources:  _:    type: lxd:Network    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 config settings.
Description string
Optional - Description of the network.
Managed bool
Whether or not the network is managed.
Name string
Required - Name of the network. This is usually the device the network will appear as to instances.
Project string
Optional - Name of the project where the network 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.
Target string
Optional - Specify a target node in a cluster.
Type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
Config map[string]string
Optional - Map of key/value pairs of network config settings.
Description string
Optional - Description of the network.
Managed bool
Whether or not the network is managed.
Name string
Required - Name of the network. This is usually the device the network will appear as to instances.
Project string
Optional - Name of the project where the network 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.
Target string
Optional - Specify a target node in a cluster.
Type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Map<String,String>
Optional - Map of key/value pairs of network config settings.
description String
Optional - Description of the network.
managed Boolean
Whether or not the network is managed.
name String
Required - Name of the network. This is usually the device the network will appear as to instances.
project String
Optional - Name of the project where the network 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.
target String
Optional - Specify a target node in a cluster.
type String
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config {[key: string]: string}
Optional - Map of key/value pairs of network config settings.
description string
Optional - Description of the network.
managed boolean
Whether or not the network is managed.
name string
Required - Name of the network. This is usually the device the network will appear as to instances.
project string
Optional - Name of the project where the network 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.
target string
Optional - Specify a target node in a cluster.
type string
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Mapping[str, str]
Optional - Map of key/value pairs of network config settings.
description str
Optional - Description of the network.
managed bool
Whether or not the network is managed.
name str
Required - Name of the network. This is usually the device the network will appear as to instances.
project str
Optional - Name of the project where the network 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.
target str
Optional - Specify a target node in a cluster.
type str
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.
config Map<String>
Optional - Map of key/value pairs of network config settings.
description String
Optional - Description of the network.
managed Boolean
Whether or not the network is managed.
name String
Required - Name of the network. This is usually the device the network will appear as to instances.
project String
Optional - Name of the project where the network 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.
target String
Optional - Specify a target node in a cluster.
type String
Optional - The type of network to create. Can be one of: bridge, macvlan, sriov, ovn, or physical. If no type is specified, a bridge network is created.

Package Details

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