openstack.networking.Network
Explore with Pulumi AI
Manages a V2 Neutron network resource within OpenStack.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network1 = new openstack.networking.Network("network_1", {
name: "network_1",
adminStateUp: true,
});
const subnet1 = new openstack.networking.Subnet("subnet_1", {
name: "subnet_1",
networkId: network1.id,
cidr: "192.168.199.0/24",
ipVersion: 4,
});
const secgroup1 = new openstack.networking.SecGroup("secgroup_1", {
name: "secgroup_1",
description: "a security group",
});
const secgroupRule1 = new openstack.networking.SecGroupRule("secgroup_rule_1", {
direction: "ingress",
ethertype: "IPv4",
protocol: "tcp",
portRangeMin: 22,
portRangeMax: 22,
remoteIpPrefix: "0.0.0.0/0",
securityGroupId: secgroup1.id,
});
const port1 = new openstack.networking.Port("port_1", {
name: "port_1",
networkId: network1.id,
adminStateUp: true,
securityGroupIds: [secgroup1.id],
fixedIps: [{
subnetId: subnet1.id,
ipAddress: "192.168.199.10",
}],
});
const instance1 = new openstack.compute.Instance("instance_1", {
name: "instance_1",
securityGroups: [secgroup1.name],
networks: [{
port: port1.id,
}],
});
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network_1",
name="network_1",
admin_state_up=True)
subnet1 = openstack.networking.Subnet("subnet_1",
name="subnet_1",
network_id=network1.id,
cidr="192.168.199.0/24",
ip_version=4)
secgroup1 = openstack.networking.SecGroup("secgroup_1",
name="secgroup_1",
description="a security group")
secgroup_rule1 = openstack.networking.SecGroupRule("secgroup_rule_1",
direction="ingress",
ethertype="IPv4",
protocol="tcp",
port_range_min=22,
port_range_max=22,
remote_ip_prefix="0.0.0.0/0",
security_group_id=secgroup1.id)
port1 = openstack.networking.Port("port_1",
name="port_1",
network_id=network1.id,
admin_state_up=True,
security_group_ids=[secgroup1.id],
fixed_ips=[{
"subnet_id": subnet1.id,
"ip_address": "192.168.199.10",
}])
instance1 = openstack.compute.Instance("instance_1",
name="instance_1",
security_groups=[secgroup1.name],
networks=[{
"port": port1.id,
}])
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/compute"
"github.com/pulumi/pulumi-openstack/sdk/v5/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, "network_1", &networking.NetworkArgs{
Name: pulumi.String("network_1"),
AdminStateUp: pulumi.Bool(true),
})
if err != nil {
return err
}
subnet1, err := networking.NewSubnet(ctx, "subnet_1", &networking.SubnetArgs{
Name: pulumi.String("subnet_1"),
NetworkId: network1.ID(),
Cidr: pulumi.String("192.168.199.0/24"),
IpVersion: pulumi.Int(4),
})
if err != nil {
return err
}
secgroup1, err := networking.NewSecGroup(ctx, "secgroup_1", &networking.SecGroupArgs{
Name: pulumi.String("secgroup_1"),
Description: pulumi.String("a security group"),
})
if err != nil {
return err
}
_, err = networking.NewSecGroupRule(ctx, "secgroup_rule_1", &networking.SecGroupRuleArgs{
Direction: pulumi.String("ingress"),
Ethertype: pulumi.String("IPv4"),
Protocol: pulumi.String("tcp"),
PortRangeMin: pulumi.Int(22),
PortRangeMax: pulumi.Int(22),
RemoteIpPrefix: pulumi.String("0.0.0.0/0"),
SecurityGroupId: secgroup1.ID(),
})
if err != nil {
return err
}
port1, err := networking.NewPort(ctx, "port_1", &networking.PortArgs{
Name: pulumi.String("port_1"),
NetworkId: network1.ID(),
AdminStateUp: pulumi.Bool(true),
SecurityGroupIds: pulumi.StringArray{
secgroup1.ID(),
},
FixedIps: networking.PortFixedIpArray{
&networking.PortFixedIpArgs{
SubnetId: subnet1.ID(),
IpAddress: pulumi.String("192.168.199.10"),
},
},
})
if err != nil {
return err
}
_, err = compute.NewInstance(ctx, "instance_1", &compute.InstanceArgs{
Name: pulumi.String("instance_1"),
SecurityGroups: pulumi.StringArray{
secgroup1.Name,
},
Networks: compute.InstanceNetworkArray{
&compute.InstanceNetworkArgs{
Port: port1.ID(),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var network1 = new OpenStack.Networking.Network("network_1", new()
{
Name = "network_1",
AdminStateUp = true,
});
var subnet1 = new OpenStack.Networking.Subnet("subnet_1", new()
{
Name = "subnet_1",
NetworkId = network1.Id,
Cidr = "192.168.199.0/24",
IpVersion = 4,
});
var secgroup1 = new OpenStack.Networking.SecGroup("secgroup_1", new()
{
Name = "secgroup_1",
Description = "a security group",
});
var secgroupRule1 = new OpenStack.Networking.SecGroupRule("secgroup_rule_1", new()
{
Direction = "ingress",
Ethertype = "IPv4",
Protocol = "tcp",
PortRangeMin = 22,
PortRangeMax = 22,
RemoteIpPrefix = "0.0.0.0/0",
SecurityGroupId = secgroup1.Id,
});
var port1 = new OpenStack.Networking.Port("port_1", new()
{
Name = "port_1",
NetworkId = network1.Id,
AdminStateUp = true,
SecurityGroupIds = new[]
{
secgroup1.Id,
},
FixedIps = new[]
{
new OpenStack.Networking.Inputs.PortFixedIpArgs
{
SubnetId = subnet1.Id,
IpAddress = "192.168.199.10",
},
},
});
var instance1 = new OpenStack.Compute.Instance("instance_1", new()
{
Name = "instance_1",
SecurityGroups = new[]
{
secgroup1.Name,
},
Networks = new[]
{
new OpenStack.Compute.Inputs.InstanceNetworkArgs
{
Port = port1.Id,
},
},
});
});
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.networking.SecGroup;
import com.pulumi.openstack.networking.SecGroupArgs;
import com.pulumi.openstack.networking.SecGroupRule;
import com.pulumi.openstack.networking.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()
.name("network_1")
.adminStateUp("true")
.build());
var subnet1 = new Subnet("subnet1", SubnetArgs.builder()
.name("subnet_1")
.networkId(network1.id())
.cidr("192.168.199.0/24")
.ipVersion(4)
.build());
var secgroup1 = new SecGroup("secgroup1", SecGroupArgs.builder()
.name("secgroup_1")
.description("a security group")
.build());
var secgroupRule1 = new SecGroupRule("secgroupRule1", SecGroupRuleArgs.builder()
.direction("ingress")
.ethertype("IPv4")
.protocol("tcp")
.portRangeMin(22)
.portRangeMax(22)
.remoteIpPrefix("0.0.0.0/0")
.securityGroupId(secgroup1.id())
.build());
var port1 = new Port("port1", PortArgs.builder()
.name("port_1")
.networkId(network1.id())
.adminStateUp("true")
.securityGroupIds(secgroup1.id())
.fixedIps(PortFixedIpArgs.builder()
.subnetId(subnet1.id())
.ipAddress("192.168.199.10")
.build())
.build());
var instance1 = new Instance("instance1", InstanceArgs.builder()
.name("instance_1")
.securityGroups(secgroup1.name())
.networks(InstanceNetworkArgs.builder()
.port(port1.id())
.build())
.build());
}
}
resources:
network1:
type: openstack:networking:Network
name: network_1
properties:
name: network_1
adminStateUp: 'true'
subnet1:
type: openstack:networking:Subnet
name: subnet_1
properties:
name: subnet_1
networkId: ${network1.id}
cidr: 192.168.199.0/24
ipVersion: 4
secgroup1:
type: openstack:networking:SecGroup
name: secgroup_1
properties:
name: secgroup_1
description: a security group
secgroupRule1:
type: openstack:networking:SecGroupRule
name: secgroup_rule_1
properties:
direction: ingress
ethertype: IPv4
protocol: tcp
portRangeMin: 22
portRangeMax: 22
remoteIpPrefix: 0.0.0.0/0
securityGroupId: ${secgroup1.id}
port1:
type: openstack:networking:Port
name: port_1
properties:
name: port_1
networkId: ${network1.id}
adminStateUp: 'true'
securityGroupIds:
- ${secgroup1.id}
fixedIps:
- subnetId: ${subnet1.id}
ipAddress: 192.168.199.10
instance1:
type: openstack:compute:Instance
name: instance_1
properties:
name: instance_1
securityGroups:
- ${secgroup1.name}
networks:
- port: ${port1.id}
Create Network Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
args: Optional[NetworkArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
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, str]] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: openstack:networking:Network
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var networkResource = new OpenStack.Networking.Network("networkResource", new()
{
AdminStateUp = false,
AvailabilityZoneHints = new[]
{
"string",
},
Description = "string",
DnsDomain = "string",
External = false,
Mtu = 0,
Name = "string",
PortSecurityEnabled = false,
QosPolicyId = "string",
Region = "string",
Segments = new[]
{
new OpenStack.Networking.Inputs.NetworkSegmentArgs
{
NetworkType = "string",
PhysicalNetwork = "string",
SegmentationId = 0,
},
},
Shared = false,
Tags = new[]
{
"string",
},
TenantId = "string",
TransparentVlan = false,
ValueSpecs =
{
{ "string", "string" },
},
});
example, err := networking.NewNetwork(ctx, "networkResource", &networking.NetworkArgs{
AdminStateUp: pulumi.Bool(false),
AvailabilityZoneHints: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
DnsDomain: pulumi.String("string"),
External: pulumi.Bool(false),
Mtu: pulumi.Int(0),
Name: pulumi.String("string"),
PortSecurityEnabled: pulumi.Bool(false),
QosPolicyId: pulumi.String("string"),
Region: pulumi.String("string"),
Segments: networking.NetworkSegmentArray{
&networking.NetworkSegmentArgs{
NetworkType: pulumi.String("string"),
PhysicalNetwork: pulumi.String("string"),
SegmentationId: pulumi.Int(0),
},
},
Shared: pulumi.Bool(false),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
TenantId: pulumi.String("string"),
TransparentVlan: pulumi.Bool(false),
ValueSpecs: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var networkResource = new Network("networkResource", NetworkArgs.builder()
.adminStateUp(false)
.availabilityZoneHints("string")
.description("string")
.dnsDomain("string")
.external(false)
.mtu(0)
.name("string")
.portSecurityEnabled(false)
.qosPolicyId("string")
.region("string")
.segments(NetworkSegmentArgs.builder()
.networkType("string")
.physicalNetwork("string")
.segmentationId(0)
.build())
.shared(false)
.tags("string")
.tenantId("string")
.transparentVlan(false)
.valueSpecs(Map.of("string", "string"))
.build());
network_resource = openstack.networking.Network("networkResource",
admin_state_up=False,
availability_zone_hints=["string"],
description="string",
dns_domain="string",
external=False,
mtu=0,
name="string",
port_security_enabled=False,
qos_policy_id="string",
region="string",
segments=[{
"network_type": "string",
"physical_network": "string",
"segmentation_id": 0,
}],
shared=False,
tags=["string"],
tenant_id="string",
transparent_vlan=False,
value_specs={
"string": "string",
})
const networkResource = new openstack.networking.Network("networkResource", {
adminStateUp: false,
availabilityZoneHints: ["string"],
description: "string",
dnsDomain: "string",
external: false,
mtu: 0,
name: "string",
portSecurityEnabled: false,
qosPolicyId: "string",
region: "string",
segments: [{
networkType: "string",
physicalNetwork: "string",
segmentationId: 0,
}],
shared: false,
tags: ["string"],
tenantId: "string",
transparentVlan: false,
valueSpecs: {
string: "string",
},
});
type: openstack:networking:Network
properties:
adminStateUp: false
availabilityZoneHints:
- string
description: string
dnsDomain: string
external: false
mtu: 0
name: string
portSecurityEnabled: false
qosPolicyId: string
region: string
segments:
- networkType: string
physicalNetwork: string
segmentationId: 0
shared: false
tags:
- string
tenantId: string
transparentVlan: false
valueSpecs:
string: string
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Network resource accepts the following input properties:
- 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - Segments
List<Pulumi.
Open Stack. Networking. Inputs. Network Segment> - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - Value
Specs Dictionary<string, string> - 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - Segments
[]Network
Segment Args - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - Value
Specs map[string]string - 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 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
List<Network
Segment> - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- Boolean
- 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 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. - value
Specs Map<String,String> - 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
Network
Segment[] - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - value
Specs {[key: string]: string} - 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_ Sequence[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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
Sequence[Network
Segment Args] - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- bool
- Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- 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, str] - 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 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
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. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- Boolean
- 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 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. - value
Specs Map<String> - 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.
- []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.
- 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.
- 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.
- 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.
- 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 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, str]] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
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.
- 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - Segments
List<Pulumi.
Open Stack. Networking. Inputs. Network Segment> - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - Value
Specs Dictionary<string, string> - 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - Segments
[]Network
Segment Args - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - Value
Specs map[string]string - 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.
- 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
List<Network
Segment> - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- Boolean
- 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 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. - value
Specs Map<String,String> - 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
Network
Segment[] - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- 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_vlan
attribute of the existing network. - value
Specs {[key: string]: string} - 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.
- Sequence[str]
- The collection of tags assigned on the network, which have been explicitly and implicitly added.
- availability_
zone_ Sequence[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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
region
argument of the provider is used. Changing this creates a new network. - segments
Sequence[Network
Segment Args] - An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- bool
- Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
- 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, str] - 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.
- 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_domain
of a network in conjunction with thedns_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 Neutronnet-mtu-writable
extension 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
false
will disable port security. Valid values aretrue
andfalse
. - 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
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. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
- Boolean
- 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 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. - value
Specs Map<String> - Map of additional options.
Supporting Types
NetworkSegment, NetworkSegmentArgs
- 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 Integer - 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 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.
Import
Networks can be imported using the id
, e.g.
$ pulumi import openstack:networking/network:Network network_1 d90ce693-5ccf-4136-a0ed-152ce412b6b9
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.