OpenStack

v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

Network

Manages a V2 Neutron network resource within OpenStack.

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var network1 = new OpenStack.Networking.Network("network1", new OpenStack.Networking.NetworkArgs
        {
            AdminStateUp = true,
        });
        var subnet1 = new OpenStack.Networking.Subnet("subnet1", new OpenStack.Networking.SubnetArgs
        {
            Cidr = "192.168.199.0/24",
            IpVersion = 4,
            NetworkId = network1.Id,
        });
        var secgroup1 = new OpenStack.Compute.SecGroup("secgroup1", new OpenStack.Compute.SecGroupArgs
        {
            Description = "a security group",
            Rules = 
            {
                new OpenStack.Compute.Inputs.SecGroupRuleArgs
                {
                    Cidr = "0.0.0.0/0",
                    FromPort = 22,
                    IpProtocol = "tcp",
                    ToPort = 22,
                },
            },
        });
        var port1 = new OpenStack.Networking.Port("port1", new OpenStack.Networking.PortArgs
        {
            AdminStateUp = true,
            FixedIps = 
            {
                new OpenStack.Networking.Inputs.PortFixedIpArgs
                {
                    IpAddress = "192.168.199.10",
                    SubnetId = subnet1.Id,
                },
            },
            NetworkId = network1.Id,
            SecurityGroupIds = 
            {
                secgroup1.Id,
            },
        });
        var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
        {
            Networks = 
            {
                new OpenStack.Compute.Inputs.InstanceNetworkArgs
                {
                    Port = port1.Id,
                },
            },
            SecurityGroups = 
            {
                secgroup1.Name,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		network1, err := networking.NewNetwork(ctx, "network1", &networking.NetworkArgs{
			AdminStateUp: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		subnet1, err := networking.NewSubnet(ctx, "subnet1", &networking.SubnetArgs{
			Cidr:      pulumi.String("192.168.199.0/24"),
			IpVersion: pulumi.Int(4),
			NetworkId: network1.ID(),
		})
		if err != nil {
			return err
		}
		secgroup1, err := compute.NewSecGroup(ctx, "secgroup1", &compute.SecGroupArgs{
			Description: pulumi.String("a security group"),
			Rules: compute.SecGroupRuleArray{
				&compute.SecGroupRuleArgs{
					Cidr:       pulumi.String("0.0.0.0/0"),
					FromPort:   pulumi.Int(22),
					IpProtocol: pulumi.String("tcp"),
					ToPort:     pulumi.Int(22),
				},
			},
		})
		if err != nil {
			return err
		}
		port1, err := networking.NewPort(ctx, "port1", &networking.PortArgs{
			AdminStateUp: pulumi.Bool(true),
			FixedIps: networking.PortFixedIpArray{
				&networking.PortFixedIpArgs{
					IpAddress: pulumi.String("192.168.199.10"),
					SubnetId:  subnet1.ID(),
				},
			},
			NetworkId: network1.ID(),
			SecurityGroupIds: pulumi.StringArray{
				secgroup1.ID(),
			},
		})
		if err != nil {
			return err
		}
		_, err = compute.NewInstance(ctx, "instance1", &compute.InstanceArgs{
			Networks: compute.InstanceNetworkArray{
				&compute.InstanceNetworkArgs{
					Port: port1.ID(),
				},
			},
			SecurityGroups: pulumi.StringArray{
				secgroup1.Name,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.networking.Network;
import com.pulumi.openstack.networking.NetworkArgs;
import com.pulumi.openstack.networking.Subnet;
import com.pulumi.openstack.networking.SubnetArgs;
import com.pulumi.openstack.compute.SecGroup;
import com.pulumi.openstack.compute.SecGroupArgs;
import com.pulumi.openstack.compute.inputs.SecGroupRuleArgs;
import com.pulumi.openstack.networking.Port;
import com.pulumi.openstack.networking.PortArgs;
import com.pulumi.openstack.networking.inputs.PortFixedIpArgs;
import com.pulumi.openstack.compute.Instance;
import com.pulumi.openstack.compute.InstanceArgs;
import com.pulumi.openstack.compute.inputs.InstanceNetworkArgs;
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 network1 = new Network("network1", NetworkArgs.builder()        
            .adminStateUp("true")
            .build());

        var subnet1 = new Subnet("subnet1", SubnetArgs.builder()        
            .cidr("192.168.199.0/24")
            .ipVersion(4)
            .networkId(network1.id())
            .build());

        var secgroup1 = new SecGroup("secgroup1", SecGroupArgs.builder()        
            .description("a security group")
            .rules(SecGroupRuleArgs.builder()
                .cidr("0.0.0.0/0")
                .fromPort(22)
                .ipProtocol("tcp")
                .toPort(22)
                .build())
            .build());

        var port1 = new Port("port1", PortArgs.builder()        
            .adminStateUp("true")
            .fixedIps(PortFixedIpArgs.builder()
                .ipAddress("192.168.199.10")
                .subnetId(subnet1.id())
                .build())
            .networkId(network1.id())
            .securityGroupIds(secgroup1.id())
            .build());

        var instance1 = new Instance("instance1", InstanceArgs.builder()        
            .networks(InstanceNetworkArgs.builder()
                .port(port1.id())
                .build())
            .securityGroups(secgroup1.name())
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

network1 = openstack.networking.Network("network1", admin_state_up=True)
subnet1 = openstack.networking.Subnet("subnet1",
    cidr="192.168.199.0/24",
    ip_version=4,
    network_id=network1.id)
secgroup1 = openstack.compute.SecGroup("secgroup1",
    description="a security group",
    rules=[openstack.compute.SecGroupRuleArgs(
        cidr="0.0.0.0/0",
        from_port=22,
        ip_protocol="tcp",
        to_port=22,
    )])
port1 = openstack.networking.Port("port1",
    admin_state_up=True,
    fixed_ips=[openstack.networking.PortFixedIpArgs(
        ip_address="192.168.199.10",
        subnet_id=subnet1.id,
    )],
    network_id=network1.id,
    security_group_ids=[secgroup1.id])
instance1 = openstack.compute.Instance("instance1",
    networks=[openstack.compute.InstanceNetworkArgs(
        port=port1.id,
    )],
    security_groups=[secgroup1.name])
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const network1 = new openstack.networking.Network("network_1", {
    adminStateUp: true,
});
const subnet1 = new openstack.networking.Subnet("subnet_1", {
    cidr: "192.168.199.0/24",
    ipVersion: 4,
    networkId: network1.id,
});
const secgroup1 = new openstack.compute.SecGroup("secgroup_1", {
    description: "a security group",
    rules: [{
        cidr: "0.0.0.0/0",
        fromPort: 22,
        ipProtocol: "tcp",
        toPort: 22,
    }],
});
const port1 = new openstack.networking.Port("port_1", {
    adminStateUp: true,
    fixedIps: [{
        ipAddress: "192.168.199.10",
        subnetId: subnet1.id,
    }],
    networkId: network1.id,
    securityGroupIds: [secgroup1.id],
});
const instance1 = new openstack.compute.Instance("instance_1", {
    networks: [{
        port: port1.id,
    }],
    securityGroups: [secgroup1.name],
});
resources:
  network1:
    type: openstack:networking:Network
    properties:
      adminStateUp: true
  subnet1:
    type: openstack:networking:Subnet
    properties:
      cidr: 192.168.199.0/24
      ipVersion: 4
      networkId: ${network1.id}
  secgroup1:
    type: openstack:compute:SecGroup
    properties:
      description: a security group
      rules:
        - cidr: 0.0.0.0/0
          fromPort: 22
          ipProtocol: tcp
          toPort: 22
  port1:
    type: openstack:networking:Port
    properties:
      adminStateUp: true
      fixedIps:
        - ipAddress: 192.168.199.10
          subnetId: ${subnet1.id}
      networkId: ${network1.id}
      securityGroupIds:
        - ${secgroup1.id}
  instance1:
    type: openstack:compute:Instance
    properties:
      networks:
        - port: ${port1.id}
      securityGroups:
        - ${secgroup1.name}

Create a Network Resource

new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            admin_state_up: Optional[bool] = None,
            availability_zone_hints: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            dns_domain: Optional[str] = None,
            external: Optional[bool] = None,
            mtu: Optional[int] = None,
            name: Optional[str] = None,
            port_security_enabled: Optional[bool] = None,
            qos_policy_id: Optional[str] = None,
            region: Optional[str] = None,
            segments: Optional[Sequence[NetworkSegmentArgs]] = None,
            shared: Optional[bool] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[str] = None,
            transparent_vlan: Optional[bool] = None,
            value_specs: Optional[Mapping[str, Any]] = None)
@overload
def Network(resource_name: str,
            args: Optional[NetworkArgs] = None,
            opts: Optional[ResourceOptions] = 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: openstack:networking:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name 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 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 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 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 String
The unique name of the resource.
args NetworkArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The Network resource accepts the following input properties:

AdminStateUp bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

AvailabilityZoneHints List<string>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

Description string

Human-readable description of the network. Changing this updates the name of the existing network.

DnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

External bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

Mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

Name string

The name of the network. Changing this updates the name of the existing network.

PortSecurityEnabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

QosPolicyId string

Reference to the associated QoS policy.

Region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

Segments List<Pulumi.OpenStack.Networking.Inputs.NetworkSegmentArgs>

An array of one or more provider segment objects.

Shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

Tags List<string>

A set of string tags for the network.

TenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

TransparentVlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

ValueSpecs Dictionary<string, object>

Map of additional options.

AdminStateUp bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

AvailabilityZoneHints []string

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

Description string

Human-readable description of the network. Changing this updates the name of the existing network.

DnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

External bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

Mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

Name string

The name of the network. Changing this updates the name of the existing network.

PortSecurityEnabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

QosPolicyId string

Reference to the associated QoS policy.

Region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

Segments []NetworkSegmentArgs

An array of one or more provider segment objects.

Shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

Tags []string

A set of string tags for the network.

TenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

TransparentVlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

ValueSpecs map[string]interface{}

Map of additional options.

adminStateUp Boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

availabilityZoneHints List<String>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description String

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain String

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external Boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu Integer

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name String

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled Boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId String

Reference to the associated QoS policy.

region String

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments List<NetworkSegmentArgs>

An array of one or more provider segment objects.

shared Boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags List<String>

A set of string tags for the network.

tenantId String

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan Boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs Map<String,Object>

Map of additional options.

adminStateUp boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

availabilityZoneHints string[]

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description string

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu number

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name string

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId string

Reference to the associated QoS policy.

region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments NetworkSegmentArgs[]

An array of one or more provider segment objects.

shared boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags string[]

A set of string tags for the network.

tenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs {[key: string]: any}

Map of additional options.

admin_state_up bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

availability_zone_hints Sequence[str]

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description str

Human-readable description of the network. Changing this updates the name of the existing network.

dns_domain str

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name str

The name of the network. Changing this updates the name of the existing network.

port_security_enabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qos_policy_id str

Reference to the associated QoS policy.

region str

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments Sequence[NetworkSegmentArgs]

An array of one or more provider segment objects.

shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags Sequence[str]

A set of string tags for the network.

tenant_id str

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparent_vlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

value_specs Mapping[str, Any]

Map of additional options.

adminStateUp Boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

availabilityZoneHints List<String>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description String

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain String

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external Boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu Number

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name String

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled Boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId String

Reference to the associated QoS policy.

region String

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments List<Property Map>

An array of one or more provider segment objects.

shared Boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags List<String>

A set of string tags for the network.

tenantId String

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan Boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs Map<Any>

Map of additional options.

Outputs

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

AllTags List<string>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

Id string

The provider-assigned unique ID for this managed resource.

AllTags []string

The collection of tags assigned on the network, which have been explicitly and implicitly added.

Id string

The provider-assigned unique ID for this managed resource.

allTags List<String>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

id String

The provider-assigned unique ID for this managed resource.

allTags string[]

The collection of tags assigned on the network, which have been explicitly and implicitly added.

id string

The provider-assigned unique ID for this managed resource.

all_tags Sequence[str]

The collection of tags assigned on the network, which have been explicitly and implicitly added.

id str

The provider-assigned unique ID for this managed resource.

allTags List<String>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

id String

The provider-assigned unique ID for this managed resource.

Look up an 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,
        admin_state_up: Optional[bool] = None,
        all_tags: Optional[Sequence[str]] = None,
        availability_zone_hints: Optional[Sequence[str]] = None,
        description: Optional[str] = None,
        dns_domain: Optional[str] = None,
        external: Optional[bool] = None,
        mtu: Optional[int] = None,
        name: Optional[str] = None,
        port_security_enabled: Optional[bool] = None,
        qos_policy_id: Optional[str] = None,
        region: Optional[str] = None,
        segments: Optional[Sequence[NetworkSegmentArgs]] = None,
        shared: Optional[bool] = None,
        tags: Optional[Sequence[str]] = None,
        tenant_id: Optional[str] = None,
        transparent_vlan: Optional[bool] = None,
        value_specs: Optional[Mapping[str, Any]] = 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)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
AdminStateUp bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

AllTags List<string>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

AvailabilityZoneHints List<string>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

Description string

Human-readable description of the network. Changing this updates the name of the existing network.

DnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

External bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

Mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

Name string

The name of the network. Changing this updates the name of the existing network.

PortSecurityEnabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

QosPolicyId string

Reference to the associated QoS policy.

Region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

Segments List<Pulumi.OpenStack.Networking.Inputs.NetworkSegmentArgs>

An array of one or more provider segment objects.

Shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

Tags List<string>

A set of string tags for the network.

TenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

TransparentVlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

ValueSpecs Dictionary<string, object>

Map of additional options.

AdminStateUp bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

AllTags []string

The collection of tags assigned on the network, which have been explicitly and implicitly added.

AvailabilityZoneHints []string

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

Description string

Human-readable description of the network. Changing this updates the name of the existing network.

DnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

External bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

Mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

Name string

The name of the network. Changing this updates the name of the existing network.

PortSecurityEnabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

QosPolicyId string

Reference to the associated QoS policy.

Region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

Segments []NetworkSegmentArgs

An array of one or more provider segment objects.

Shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

Tags []string

A set of string tags for the network.

TenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

TransparentVlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

ValueSpecs map[string]interface{}

Map of additional options.

adminStateUp Boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

allTags List<String>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

availabilityZoneHints List<String>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description String

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain String

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external Boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu Integer

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name String

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled Boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId String

Reference to the associated QoS policy.

region String

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments List<NetworkSegmentArgs>

An array of one or more provider segment objects.

shared Boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags List<String>

A set of string tags for the network.

tenantId String

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan Boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs Map<String,Object>

Map of additional options.

adminStateUp boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

allTags string[]

The collection of tags assigned on the network, which have been explicitly and implicitly added.

availabilityZoneHints string[]

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description string

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain string

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu number

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name string

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId string

Reference to the associated QoS policy.

region string

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments NetworkSegmentArgs[]

An array of one or more provider segment objects.

shared boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags string[]

A set of string tags for the network.

tenantId string

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs {[key: string]: any}

Map of additional options.

admin_state_up bool

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

all_tags Sequence[str]

The collection of tags assigned on the network, which have been explicitly and implicitly added.

availability_zone_hints Sequence[str]

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description str

Human-readable description of the network. Changing this updates the name of the existing network.

dns_domain str

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external bool

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu int

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name str

The name of the network. Changing this updates the name of the existing network.

port_security_enabled bool

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qos_policy_id str

Reference to the associated QoS policy.

region str

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments Sequence[NetworkSegmentArgs]

An array of one or more provider segment objects.

shared bool

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags Sequence[str]

A set of string tags for the network.

tenant_id str

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparent_vlan bool

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

value_specs Mapping[str, Any]

Map of additional options.

adminStateUp Boolean

The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.

allTags List<String>

The collection of tags assigned on the network, which have been explicitly and implicitly added.

availabilityZoneHints List<String>

An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.

description String

Human-readable description of the network. Changing this updates the name of the existing network.

dnsDomain String

The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.

external Boolean

Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.

mtu Number

The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.

name String

The name of the network. Changing this updates the name of the existing network.

portSecurityEnabled Boolean

Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.

qosPolicyId String

Reference to the associated QoS policy.

region String

The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.

segments List<Property Map>

An array of one or more provider segment objects.

shared Boolean

Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.

tags List<String>

A set of string tags for the network.

tenantId String

The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.

transparentVlan Boolean

Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.

valueSpecs Map<Any>

Map of additional options.

Supporting Types

NetworkSegment

NetworkType string

The type of physical network.

PhysicalNetwork string

The physical network where this network is implemented.

SegmentationId int

An isolated segment on the physical network.

NetworkType string

The type of physical network.

PhysicalNetwork string

The physical network where this network is implemented.

SegmentationId int

An isolated segment on the physical network.

networkType String

The type of physical network.

physicalNetwork String

The physical network where this network is implemented.

segmentationId Integer

An isolated segment on the physical network.

networkType string

The type of physical network.

physicalNetwork string

The physical network where this network is implemented.

segmentationId number

An isolated segment on the physical network.

network_type str

The type of physical network.

physical_network str

The physical network where this network is implemented.

segmentation_id int

An isolated segment on the physical network.

networkType String

The type of physical network.

physicalNetwork String

The physical network where this network is implemented.

segmentationId Number

An isolated segment on the physical network.

Import

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

 $ pulumi import openstack:networking/network:Network network_1 d90ce693-5ccf-4136-a0ed-152ce412b6b9

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.