1. Packages
  2. OpenStack
  3. API Docs
  4. networking
  5. Network
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

openstack.networking.Network

Explore with Pulumi AI

openstack logo
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

    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("network1", {adminStateUp: true});
    const subnet1 = new openstack.networking.Subnet("subnet1", {
        networkId: network1.id,
        cidr: "192.168.199.0/24",
        ipVersion: 4,
    });
    const secgroup1 = new openstack.compute.SecGroup("secgroup1", {
        description: "a security group",
        rules: [{
            fromPort: 22,
            toPort: 22,
            ipProtocol: "tcp",
            cidr: "0.0.0.0/0",
        }],
    });
    const port1 = new openstack.networking.Port("port1", {
        networkId: network1.id,
        adminStateUp: true,
        securityGroupIds: [secgroup1.id],
        fixedIps: [{
            subnetId: subnet1.id,
            ipAddress: "192.168.199.10",
        }],
    });
    const instance1 = new openstack.compute.Instance("instance1", {
        securityGroups: [secgroup1.name],
        networks: [{
            port: port1.id,
        }],
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    network1 = openstack.networking.Network("network1", admin_state_up=True)
    subnet1 = openstack.networking.Subnet("subnet1",
        network_id=network1.id,
        cidr="192.168.199.0/24",
        ip_version=4)
    secgroup1 = openstack.compute.SecGroup("secgroup1",
        description="a security group",
        rules=[openstack.compute.SecGroupRuleArgs(
            from_port=22,
            to_port=22,
            ip_protocol="tcp",
            cidr="0.0.0.0/0",
        )])
    port1 = openstack.networking.Port("port1",
        network_id=network1.id,
        admin_state_up=True,
        security_group_ids=[secgroup1.id],
        fixed_ips=[openstack.networking.PortFixedIpArgs(
            subnet_id=subnet1.id,
            ip_address="192.168.199.10",
        )])
    instance1 = openstack.compute.Instance("instance1",
        security_groups=[secgroup1.name],
        networks=[openstack.compute.InstanceNetworkArgs(
            port=port1.id,
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		network1, err := networking.NewNetwork(ctx, "network1", &networking.NetworkArgs{
    			AdminStateUp: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		subnet1, err := networking.NewSubnet(ctx, "subnet1", &networking.SubnetArgs{
    			NetworkId: network1.ID(),
    			Cidr:      pulumi.String("192.168.199.0/24"),
    			IpVersion: pulumi.Int(4),
    		})
    		if err != nil {
    			return err
    		}
    		secgroup1, err := compute.NewSecGroup(ctx, "secgroup1", &compute.SecGroupArgs{
    			Description: pulumi.String("a security group"),
    			Rules: compute.SecGroupRuleArray{
    				&compute.SecGroupRuleArgs{
    					FromPort:   pulumi.Int(22),
    					ToPort:     pulumi.Int(22),
    					IpProtocol: pulumi.String("tcp"),
    					Cidr:       pulumi.String("0.0.0.0/0"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		port1, err := networking.NewPort(ctx, "port1", &networking.PortArgs{
    			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, "instance1", &compute.InstanceArgs{
    			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("network1", new()
        {
            AdminStateUp = true,
        });
    
        var subnet1 = new OpenStack.Networking.Subnet("subnet1", new()
        {
            NetworkId = network1.Id,
            Cidr = "192.168.199.0/24",
            IpVersion = 4,
        });
    
        var secgroup1 = new OpenStack.Compute.SecGroup("secgroup1", new()
        {
            Description = "a security group",
            Rules = new[]
            {
                new OpenStack.Compute.Inputs.SecGroupRuleArgs
                {
                    FromPort = 22,
                    ToPort = 22,
                    IpProtocol = "tcp",
                    Cidr = "0.0.0.0/0",
                },
            },
        });
    
        var port1 = new OpenStack.Networking.Port("port1", new()
        {
            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("instance1", new()
        {
            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.compute.SecGroup;
    import com.pulumi.openstack.compute.SecGroupArgs;
    import com.pulumi.openstack.compute.inputs.SecGroupRuleArgs;
    import com.pulumi.openstack.networking.Port;
    import com.pulumi.openstack.networking.PortArgs;
    import com.pulumi.openstack.networking.inputs.PortFixedIpArgs;
    import com.pulumi.openstack.compute.Instance;
    import com.pulumi.openstack.compute.InstanceArgs;
    import com.pulumi.openstack.compute.inputs.InstanceNetworkArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var network1 = new Network("network1", NetworkArgs.builder()        
                .adminStateUp("true")
                .build());
    
            var subnet1 = new Subnet("subnet1", SubnetArgs.builder()        
                .networkId(network1.id())
                .cidr("192.168.199.0/24")
                .ipVersion(4)
                .build());
    
            var secgroup1 = new SecGroup("secgroup1", SecGroupArgs.builder()        
                .description("a security group")
                .rules(SecGroupRuleArgs.builder()
                    .fromPort(22)
                    .toPort(22)
                    .ipProtocol("tcp")
                    .cidr("0.0.0.0/0")
                    .build())
                .build());
    
            var port1 = new Port("port1", PortArgs.builder()        
                .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()        
                .securityGroups(secgroup1.name())
                .networks(InstanceNetworkArgs.builder()
                    .port(port1.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      network1:
        type: openstack:networking:Network
        properties:
          adminStateUp: 'true'
      subnet1:
        type: openstack:networking:Subnet
        properties:
          networkId: ${network1.id}
          cidr: 192.168.199.0/24
          ipVersion: 4
      secgroup1:
        type: openstack:compute:SecGroup
        properties:
          description: a security group
          rules:
            - fromPort: 22
              toPort: 22
              ipProtocol: tcp
              cidr: 0.0.0.0/0
      port1:
        type: openstack:networking:Port
        properties:
          networkId: ${network1.id}
          adminStateUp: 'true'
          securityGroupIds:
            - ${secgroup1.id}
          fixedIps:
            - subnetId: ${subnet1.id}
              ipAddress: 192.168.199.10
      instance1:
        type: openstack:compute:Instance
        properties:
          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, Any]] = 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.

    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", "any" },
        },
    });
    
    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.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    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", "any"))
        .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=[openstack.networking.NetworkSegmentArgs(
            network_type="string",
            physical_network="string",
            segmentation_id=0,
        )],
        shared=False,
        tags=["string"],
        tenant_id="string",
        transparent_vlan=False,
        value_specs={
            "string": "any",
        })
    
    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: "any",
        },
    });
    
    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: any
    

    Network Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Network resource accepts the following input properties:

    AdminStateUp bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    AvailabilityZoneHints List<string>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    Description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    DnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    External bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    Mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    Name string
    The name of the network. Changing this updates the name of the existing network.
    PortSecurityEnabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    QosPolicyId string
    Reference to the associated QoS policy.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    Segments List<Pulumi.OpenStack.Networking.Inputs.NetworkSegment>
    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.
    Shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    Tags List<string>
    A set of string tags for the network.
    TenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    TransparentVlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    ValueSpecs Dictionary<string, object>
    Map of additional options.
    AdminStateUp bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    AvailabilityZoneHints []string
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    Description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    DnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    External bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    Mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    Name string
    The name of the network. Changing this updates the name of the existing network.
    PortSecurityEnabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    QosPolicyId string
    Reference to the associated QoS policy.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    Segments []NetworkSegmentArgs
    An array of one or more provider segment objects. 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.
    Shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    Tags []string
    A set of string tags for the network.
    TenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    TransparentVlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    ValueSpecs map[string]interface{}
    Map of additional options.
    adminStateUp Boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    availabilityZoneHints List<String>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description String
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain String
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external Boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu Integer
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name String
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled Boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId String
    Reference to the associated QoS policy.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments List<NetworkSegment>
    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.
    shared Boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags List<String>
    A set of string tags for the network.
    tenantId String
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan Boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs Map<String,Object>
    Map of additional options.
    adminStateUp boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    availabilityZoneHints string[]
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu number
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name string
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId string
    Reference to the associated QoS policy.
    region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments NetworkSegment[]
    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.
    shared boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags string[]
    A set of string tags for the network.
    tenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs {[key: string]: any}
    Map of additional options.
    admin_state_up bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    availability_zone_hints Sequence[str]
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description str
    Human-readable description of the network. Changing this updates the name of the existing network.
    dns_domain str
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name str
    The name of the network. Changing this updates the name of the existing network.
    port_security_enabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qos_policy_id str
    Reference to the associated QoS policy.
    region str
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments Sequence[NetworkSegmentArgs]
    An array of one or more provider segment objects. 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.
    shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags Sequence[str]
    A set of string tags for the network.
    tenant_id str
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparent_vlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    value_specs Mapping[str, Any]
    Map of additional options.
    adminStateUp Boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    availabilityZoneHints List<String>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description String
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain String
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external Boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu Number
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name String
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled Boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId String
    Reference to the associated QoS policy.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments List<Property Map>
    An array of one or more provider segment objects. 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.
    shared Boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags List<String>
    A set of string tags for the network.
    tenantId String
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan Boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs Map<Any>
    Map of additional options.

    Outputs

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

    AllTags List<string>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    Id string
    The provider-assigned unique ID for this managed resource.
    AllTags []string
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    Id string
    The provider-assigned unique ID for this managed resource.
    allTags List<String>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    id String
    The provider-assigned unique ID for this managed resource.
    allTags string[]
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    id string
    The provider-assigned unique ID for this managed resource.
    all_tags Sequence[str]
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    id str
    The provider-assigned unique ID for this managed resource.
    allTags List<String>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Network Resource

    Get an existing Network resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NetworkState, opts?: CustomResourceOptions): Network
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admin_state_up: Optional[bool] = None,
            all_tags: Optional[Sequence[str]] = None,
            availability_zone_hints: Optional[Sequence[str]] = None,
            description: Optional[str] = None,
            dns_domain: Optional[str] = None,
            external: Optional[bool] = None,
            mtu: Optional[int] = None,
            name: Optional[str] = None,
            port_security_enabled: Optional[bool] = None,
            qos_policy_id: Optional[str] = None,
            region: Optional[str] = None,
            segments: Optional[Sequence[NetworkSegmentArgs]] = None,
            shared: Optional[bool] = None,
            tags: Optional[Sequence[str]] = None,
            tenant_id: Optional[str] = None,
            transparent_vlan: Optional[bool] = None,
            value_specs: Optional[Mapping[str, Any]] = None) -> Network
    func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
    public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
    public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AdminStateUp bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    AllTags List<string>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    AvailabilityZoneHints List<string>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    Description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    DnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    External bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    Mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    Name string
    The name of the network. Changing this updates the name of the existing network.
    PortSecurityEnabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    QosPolicyId string
    Reference to the associated QoS policy.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    Segments List<Pulumi.OpenStack.Networking.Inputs.NetworkSegment>
    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.
    Shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    Tags List<string>
    A set of string tags for the network.
    TenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    TransparentVlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    ValueSpecs Dictionary<string, object>
    Map of additional options.
    AdminStateUp bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    AllTags []string
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    AvailabilityZoneHints []string
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    Description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    DnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    External bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    Mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    Name string
    The name of the network. Changing this updates the name of the existing network.
    PortSecurityEnabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    QosPolicyId string
    Reference to the associated QoS policy.
    Region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    Segments []NetworkSegmentArgs
    An array of one or more provider segment objects. 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.
    Shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    Tags []string
    A set of string tags for the network.
    TenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    TransparentVlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    ValueSpecs map[string]interface{}
    Map of additional options.
    adminStateUp Boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    allTags List<String>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    availabilityZoneHints List<String>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description String
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain String
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external Boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu Integer
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name String
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled Boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId String
    Reference to the associated QoS policy.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments List<NetworkSegment>
    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.
    shared Boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags List<String>
    A set of string tags for the network.
    tenantId String
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan Boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs Map<String,Object>
    Map of additional options.
    adminStateUp boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    allTags string[]
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    availabilityZoneHints string[]
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description string
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain string
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu number
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name string
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId string
    Reference to the associated QoS policy.
    region string
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments NetworkSegment[]
    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.
    shared boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags string[]
    A set of string tags for the network.
    tenantId string
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs {[key: string]: any}
    Map of additional options.
    admin_state_up bool
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    all_tags Sequence[str]
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    availability_zone_hints Sequence[str]
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description str
    Human-readable description of the network. Changing this updates the name of the existing network.
    dns_domain str
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external bool
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu int
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name str
    The name of the network. Changing this updates the name of the existing network.
    port_security_enabled bool
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qos_policy_id str
    Reference to the associated QoS policy.
    region str
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments Sequence[NetworkSegmentArgs]
    An array of one or more provider segment objects. 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.
    shared bool
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags Sequence[str]
    A set of string tags for the network.
    tenant_id str
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparent_vlan bool
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    value_specs Mapping[str, Any]
    Map of additional options.
    adminStateUp Boolean
    The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
    allTags List<String>
    The collection of tags assigned on the network, which have been explicitly and implicitly added.
    availabilityZoneHints List<String>
    An availability zone is used to make network resources highly available. Used for resources with high availability so that they are scheduled on different availability zones. Changing this creates a new network.
    description String
    Human-readable description of the network. Changing this updates the name of the existing network.
    dnsDomain String
    The network DNS domain. Available, when Neutron DNS extension is enabled. The dns_domain of a network in conjunction with the dns_name attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
    external Boolean
    Specifies whether the network resource has the external routing facility. Valid values are true and false. Defaults to false. Changing this updates the external attribute of the existing network.
    mtu Number
    The network MTU. Available for read-only, when Neutron net-mtu extension is enabled. Available for the modification, when Neutron net-mtu-writable extension is enabled.
    name String
    The name of the network. Changing this updates the name of the existing network.
    portSecurityEnabled Boolean
    Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to false will disable port security. Valid values are true and false.
    qosPolicyId String
    Reference to the associated QoS policy.
    region String
    The region in which to obtain the V2 Networking client. A Networking client is needed to create a Neutron network. If omitted, the region argument of the provider is used. Changing this creates a new network.
    segments List<Property Map>
    An array of one or more provider segment objects. 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.
    shared Boolean
    Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
    tags List<String>
    A set of string tags for the network.
    tenantId String
    The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
    transparentVlan Boolean
    Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the transparent_vlan attribute of the existing network.
    valueSpecs Map<Any>
    Map of additional options.

    Supporting Types

    NetworkSegment, NetworkSegmentArgs

    NetworkType string
    The type of physical network.
    PhysicalNetwork string
    The physical network where this network is implemented.
    SegmentationId int
    An isolated segment on the physical network.
    NetworkType string
    The type of physical network.
    PhysicalNetwork string
    The physical network where this network is implemented.
    SegmentationId int
    An isolated segment on the physical network.
    networkType String
    The type of physical network.
    physicalNetwork String
    The physical network where this network is implemented.
    segmentationId Integer
    An isolated segment on the physical network.
    networkType string
    The type of physical network.
    physicalNetwork string
    The physical network where this network is implemented.
    segmentationId number
    An isolated segment on the physical network.
    network_type str
    The type of physical network.
    physical_network str
    The physical network where this network is implemented.
    segmentation_id int
    An isolated segment on the physical network.
    networkType String
    The type of physical network.
    physicalNetwork String
    The physical network where this network is implemented.
    segmentationId Number
    An isolated segment on the physical network.

    Import

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

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

    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.
    openstack logo
    OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi