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:
- Admin
State boolUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- Availability
Zone List<string>Hints 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.
- Dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- Name string
The name of the network. Changing this updates the name of the existing network.
- Port
Security boolEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- Qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- Segments
List<Pulumi.
Open Stack. Networking. Inputs. Network Segment Args> An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- List<string>
A set of string tags for the network.
- Tenant
Id string 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_vlanattribute of the existing network.- Value
Specs Dictionary<string, object> Map of additional options.
- Admin
State boolUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- Availability
Zone []stringHints 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.
- Dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- Name string
The name of the network. Changing this updates the name of the existing network.
- Port
Security boolEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- Qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- Segments
[]Network
Segment An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- []string
A set of string tags for the network.
- Tenant
Id string 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_vlanattribute of the existing network.- Value
Specs map[string]interface{} Map of additional options.
- admin
State booleanUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- availability
Zone string[]Hints 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.
- dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- name string
The name of the network. Changing this updates the name of the existing network.
- port
Security booleanEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- segments
Network
Segment[] An array of one or more provider segment objects.
- boolean
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- string[]
A set of string tags for the network.
- tenant
Id string The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
- transparent
Vlan 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_vlanattribute of the existing network.- value
Specs {[key: string]: any} Map of additional options.
- admin_
state_ boolup The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- availability_
zone_ List[str]hints 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_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- name str
The name of the network. Changing this updates the name of the existing network.
- port_
security_ boolenabled 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
falsewill disable port security. Valid values aretrueandfalse.- qos_
policy_ strid 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
regionargument of the provider is used. Changing this creates a new network.- segments
List[Network
Segment] An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- 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_vlanattribute 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:
- 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): Networkstatic 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:
- Admin
State boolUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- List<string>
The collection of tags assigned on the network, which have been explicitly and implicitly added.
- Availability
Zone List<string>Hints 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.
- Dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- Name string
The name of the network. Changing this updates the name of the existing network.
- Port
Security boolEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- Qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- Segments
List<Pulumi.
Open Stack. Networking. Inputs. Network Segment Args> An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- List<string>
A set of string tags for the network.
- Tenant
Id string 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_vlanattribute of the existing network.- Value
Specs Dictionary<string, object> Map of additional options.
- Admin
State boolUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- []string
The collection of tags assigned on the network, which have been explicitly and implicitly added.
- Availability
Zone []stringHints 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.
- Dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- Name string
The name of the network. Changing this updates the name of the existing network.
- Port
Security boolEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- Qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- Segments
[]Network
Segment An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- []string
A set of string tags for the network.
- Tenant
Id string 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_vlanattribute of the existing network.- Value
Specs map[string]interface{} Map of additional options.
- admin
State booleanUp The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- string[]
The collection of tags assigned on the network, which have been explicitly and implicitly added.
- availability
Zone string[]Hints 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.
- dns
Domain string The network DNS domain. Available, when Neutron DNS extension is enabled. The
dns_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- name string
The name of the network. Changing this updates the name of the existing network.
- port
Security booleanEnabled 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
falsewill disable port security. Valid values aretrueandfalse.- qos
Policy stringId 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
regionargument of the provider is used. Changing this creates a new network.- segments
Network
Segment[] An array of one or more provider segment objects.
- boolean
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- string[]
A set of string tags for the network.
- tenant
Id string The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
- transparent
Vlan 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_vlanattribute of the existing network.- value
Specs {[key: string]: any} Map of additional options.
- admin_
state_ boolup The administrative state of the network. Acceptable values are “true” and “false”. Changing this value updates the state of the existing network.
- List[str]
The collection of tags assigned on the network, which have been explicitly and implicitly added.
- availability_
zone_ List[str]hints 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_domainof a network in conjunction with thedns_nameattribute 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-mtuextension is enabled. Available for the modification, when Neutronnet-mtu-writableextension is enabled.- name str
The name of the network. Changing this updates the name of the existing network.
- port_
security_ boolenabled 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
falsewill disable port security. Valid values aretrueandfalse.- qos_
policy_ strid 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
regionargument of the provider is used. Changing this creates a new network.- segments
List[Network
Segment] An array of one or more provider segment objects.
- bool
Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- 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_vlanattribute of the existing network.- value_
specs Dict[str, Any] Map of additional options.
Supporting Types
NetworkSegment
- Network
Type string The type of physical network.
- Physical
Network string The physical network where this network is implemented.
- Segmentation
Id int An isolated segment on the physical network.
- Network
Type string The type of physical network.
- Physical
Network string The physical network where this network is implemented.
- Segmentation
Id int An isolated segment on the physical network.
- network
Type string The type of physical network.
- physical
Network string The physical network where this network is implemented.
- segmentation
Id 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 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
openstackTerraform Provider.