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,
            },
        });
    }

}

Coming soon!

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=[{
        "cidr": "0.0.0.0/0",
        "fromPort": 22,
        "ipProtocol": "tcp",
        "toPort": 22,
    }])
port1 = openstack.networking.Port("port1",
    admin_state_up="true",
    fixed_ips=[{
        "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=[{
        "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],
});

Create a Network Resource

new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
def Network(resource_name, opts=None, admin_state_up=None, availability_zone_hints=None, description=None, dns_domain=None, external=None, mtu=None, name=None, port_security_enabled=None, qos_policy_id=None, region=None, segments=None, shared=None, tags=None, tenant_id=None, transparent_vlan=None, value_specs=None, __props__=None);
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Network Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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 []NetworkSegment

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 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 NetworkSegment[]

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 List[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 float

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 List[NetworkSegment]

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[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 Dict[str, 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 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 List[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.

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
static get(resource_name, id, opts=None, admin_state_up=None, all_tags=None, availability_zone_hints=None, description=None, dns_domain=None, external=None, mtu=None, name=None, port_security_enabled=None, qos_policy_id=None, region=None, segments=None, shared=None, tags=None, tenant_id=None, transparent_vlan=None, value_specs=None, __props__=None);
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)
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.

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 []NetworkSegment

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 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 NetworkSegment[]

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 List[str]

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

availability_zone_hints List[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 float

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 List[NetworkSegment]

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[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 Dict[str, Any]

Map of additional options.

Supporting Types

NetworkSegment

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 number

An isolated segment on the physical network.

network_type str

The type of physical network.

physicalNetwork str

The physical network where this network is implemented.

segmentation_id float

An isolated segment on the physical network.

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.