1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. SegmentV2
OpenStack v5.3.2 published on Friday, Jul 18, 2025 by Pulumi

openstack.networking.SegmentV2

Explore with Pulumi AI

openstack logo
OpenStack v5.3.2 published on Friday, Jul 18, 2025 by Pulumi

    Manages a Neutron network segment resource within OpenStack.

    Note: This resource is only available if the Neutron service is configured with the segments extension.

    Note: This ussually requires admin privileges to create or manage segments.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const net1 = new openstack.networking.Network("net_1", {name: "demo-net"});
    const segment1 = new openstack.networking.SegmentV2("segment_1", {
        name: "flat-segment",
        description: "Example flat segment",
        networkId: net1.id,
        networkType: "flat",
        physicalNetwork: "public",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    net1 = openstack.networking.Network("net_1", name="demo-net")
    segment1 = openstack.networking.SegmentV2("segment_1",
        name="flat-segment",
        description="Example flat segment",
        network_id=net1.id,
        network_type="flat",
        physical_network="public")
    
    package main
    
    import (
    	"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 {
    		net1, err := networking.NewNetwork(ctx, "net_1", &networking.NetworkArgs{
    			Name: pulumi.String("demo-net"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networking.NewSegmentV2(ctx, "segment_1", &networking.SegmentV2Args{
    			Name:            pulumi.String("flat-segment"),
    			Description:     pulumi.String("Example flat segment"),
    			NetworkId:       net1.ID(),
    			NetworkType:     pulumi.String("flat"),
    			PhysicalNetwork: pulumi.String("public"),
    		})
    		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 net1 = new OpenStack.Networking.Network("net_1", new()
        {
            Name = "demo-net",
        });
    
        var segment1 = new OpenStack.Networking.SegmentV2("segment_1", new()
        {
            Name = "flat-segment",
            Description = "Example flat segment",
            NetworkId = net1.Id,
            NetworkType = "flat",
            PhysicalNetwork = "public",
        });
    
    });
    
    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.SegmentV2;
    import com.pulumi.openstack.networking.SegmentV2Args;
    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 net1 = new Network("net1", NetworkArgs.builder()
                .name("demo-net")
                .build());
    
            var segment1 = new SegmentV2("segment1", SegmentV2Args.builder()
                .name("flat-segment")
                .description("Example flat segment")
                .networkId(net1.id())
                .networkType("flat")
                .physicalNetwork("public")
                .build());
    
        }
    }
    
    resources:
      net1:
        type: openstack:networking:Network
        name: net_1
        properties:
          name: demo-net
      segment1:
        type: openstack:networking:SegmentV2
        name: segment_1
        properties:
          name: flat-segment
          description: Example flat segment
          networkId: ${net1.id}
          networkType: flat
          physicalNetwork: public
    

    Create SegmentV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SegmentV2(name: string, args: SegmentV2Args, opts?: CustomResourceOptions);
    @overload
    def SegmentV2(resource_name: str,
                  args: SegmentV2Args,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def SegmentV2(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  network_id: Optional[str] = None,
                  network_type: Optional[str] = None,
                  description: Optional[str] = None,
                  name: Optional[str] = None,
                  physical_network: Optional[str] = None,
                  region: Optional[str] = None,
                  segmentation_id: Optional[int] = None)
    func NewSegmentV2(ctx *Context, name string, args SegmentV2Args, opts ...ResourceOption) (*SegmentV2, error)
    public SegmentV2(string name, SegmentV2Args args, CustomResourceOptions? opts = null)
    public SegmentV2(String name, SegmentV2Args args)
    public SegmentV2(String name, SegmentV2Args args, CustomResourceOptions options)
    
    type: openstack:networking:SegmentV2
    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 SegmentV2Args
    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 SegmentV2Args
    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 SegmentV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SegmentV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SegmentV2Args
    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 segmentV2Resource = new OpenStack.Networking.SegmentV2("segmentV2Resource", new()
    {
        NetworkId = "string",
        NetworkType = "string",
        Description = "string",
        Name = "string",
        PhysicalNetwork = "string",
        Region = "string",
        SegmentationId = 0,
    });
    
    example, err := networking.NewSegmentV2(ctx, "segmentV2Resource", &networking.SegmentV2Args{
    	NetworkId:       pulumi.String("string"),
    	NetworkType:     pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	PhysicalNetwork: pulumi.String("string"),
    	Region:          pulumi.String("string"),
    	SegmentationId:  pulumi.Int(0),
    })
    
    var segmentV2Resource = new SegmentV2("segmentV2Resource", SegmentV2Args.builder()
        .networkId("string")
        .networkType("string")
        .description("string")
        .name("string")
        .physicalNetwork("string")
        .region("string")
        .segmentationId(0)
        .build());
    
    segment_v2_resource = openstack.networking.SegmentV2("segmentV2Resource",
        network_id="string",
        network_type="string",
        description="string",
        name="string",
        physical_network="string",
        region="string",
        segmentation_id=0)
    
    const segmentV2Resource = new openstack.networking.SegmentV2("segmentV2Resource", {
        networkId: "string",
        networkType: "string",
        description: "string",
        name: "string",
        physicalNetwork: "string",
        region: "string",
        segmentationId: 0,
    });
    
    type: openstack:networking:SegmentV2
    properties:
        description: string
        name: string
        networkId: string
        networkType: string
        physicalNetwork: string
        region: string
        segmentationId: 0
    

    SegmentV2 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 SegmentV2 resource accepts the following input properties:

    NetworkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    NetworkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    Description string
    A description for the segment.
    Name string
    A name for the segment.
    PhysicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    SegmentationId int
    A segmentation identifier. Changing is allowed only for vlan.
    NetworkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    NetworkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    Description string
    A description for the segment.
    Name string
    A name for the segment.
    PhysicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    SegmentationId int
    A segmentation identifier. Changing is allowed only for vlan.
    networkId String
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType String
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    description String
    A description for the segment.
    name String
    A name for the segment.
    physicalNetwork String
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    segmentationId Integer
    A segmentation identifier. Changing is allowed only for vlan.
    networkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    description string
    A description for the segment.
    name string
    A name for the segment.
    physicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    segmentationId number
    A segmentation identifier. Changing is allowed only for vlan.
    network_id str
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    network_type str
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    description str
    A description for the segment.
    name str
    A name for the segment.
    physical_network str
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    segmentation_id int
    A segmentation identifier. Changing is allowed only for vlan.
    networkId String
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType String
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    description String
    A description for the segment.
    name String
    A name for the segment.
    physicalNetwork String
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    segmentationId Number
    A segmentation identifier. Changing is allowed only for vlan.

    Outputs

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

    CreatedAt string
    Creation timestamp (RFC3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    RevisionNumber int
    The revision number of the segment.
    UpdatedAt string
    Last update timestamp (RFC3339 format).
    CreatedAt string
    Creation timestamp (RFC3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    RevisionNumber int
    The revision number of the segment.
    UpdatedAt string
    Last update timestamp (RFC3339 format).
    createdAt String
    Creation timestamp (RFC3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    revisionNumber Integer
    The revision number of the segment.
    updatedAt String
    Last update timestamp (RFC3339 format).
    createdAt string
    Creation timestamp (RFC3339 format).
    id string
    The provider-assigned unique ID for this managed resource.
    revisionNumber number
    The revision number of the segment.
    updatedAt string
    Last update timestamp (RFC3339 format).
    created_at str
    Creation timestamp (RFC3339 format).
    id str
    The provider-assigned unique ID for this managed resource.
    revision_number int
    The revision number of the segment.
    updated_at str
    Last update timestamp (RFC3339 format).
    createdAt String
    Creation timestamp (RFC3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    revisionNumber Number
    The revision number of the segment.
    updatedAt String
    Last update timestamp (RFC3339 format).

    Look up Existing SegmentV2 Resource

    Get an existing SegmentV2 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?: SegmentV2State, opts?: CustomResourceOptions): SegmentV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            network_type: Optional[str] = None,
            physical_network: Optional[str] = None,
            region: Optional[str] = None,
            revision_number: Optional[int] = None,
            segmentation_id: Optional[int] = None,
            updated_at: Optional[str] = None) -> SegmentV2
    func GetSegmentV2(ctx *Context, name string, id IDInput, state *SegmentV2State, opts ...ResourceOption) (*SegmentV2, error)
    public static SegmentV2 Get(string name, Input<string> id, SegmentV2State? state, CustomResourceOptions? opts = null)
    public static SegmentV2 get(String name, Output<String> id, SegmentV2State state, CustomResourceOptions options)
    resources:  _:    type: openstack:networking:SegmentV2    get:      id: ${id}
    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:
    CreatedAt string
    Creation timestamp (RFC3339 format).
    Description string
    A description for the segment.
    Name string
    A name for the segment.
    NetworkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    NetworkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    PhysicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    RevisionNumber int
    The revision number of the segment.
    SegmentationId int
    A segmentation identifier. Changing is allowed only for vlan.
    UpdatedAt string
    Last update timestamp (RFC3339 format).
    CreatedAt string
    Creation timestamp (RFC3339 format).
    Description string
    A description for the segment.
    Name string
    A name for the segment.
    NetworkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    NetworkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    PhysicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    RevisionNumber int
    The revision number of the segment.
    SegmentationId int
    A segmentation identifier. Changing is allowed only for vlan.
    UpdatedAt string
    Last update timestamp (RFC3339 format).
    createdAt String
    Creation timestamp (RFC3339 format).
    description String
    A description for the segment.
    name String
    A name for the segment.
    networkId String
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType String
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    physicalNetwork String
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    revisionNumber Integer
    The revision number of the segment.
    segmentationId Integer
    A segmentation identifier. Changing is allowed only for vlan.
    updatedAt String
    Last update timestamp (RFC3339 format).
    createdAt string
    Creation timestamp (RFC3339 format).
    description string
    A description for the segment.
    name string
    A name for the segment.
    networkId string
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType string
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    physicalNetwork string
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    revisionNumber number
    The revision number of the segment.
    segmentationId number
    A segmentation identifier. Changing is allowed only for vlan.
    updatedAt string
    Last update timestamp (RFC3339 format).
    created_at str
    Creation timestamp (RFC3339 format).
    description str
    A description for the segment.
    name str
    A name for the segment.
    network_id str
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    network_type str
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    physical_network str
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    revision_number int
    The revision number of the segment.
    segmentation_id int
    A segmentation identifier. Changing is allowed only for vlan.
    updated_at str
    Last update timestamp (RFC3339 format).
    createdAt String
    Creation timestamp (RFC3339 format).
    description String
    A description for the segment.
    name String
    A name for the segment.
    networkId String
    The UUID of the network this segment belongs to. Changing this will create a new segment.
    networkType String
    The network type. Valid values depend on the backend (e.g., vlan, vxlan, flat, gre, geneve, local). Changing this will create a new segment.
    physicalNetwork String
    The name of the physical network. Changing this will create a new segment.
    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 segment.
    revisionNumber Number
    The revision number of the segment.
    segmentationId Number
    A segmentation identifier. Changing is allowed only for vlan.
    updatedAt String
    Last update timestamp (RFC3339 format).

    Import

    This resource can be imported by specifying the segment ID:

    $ pulumi import openstack:networking/segmentV2:SegmentV2 segment1 a5e3a494-26ee-4fde-ad26-2d846c47072e
    

    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 v5.3.2 published on Friday, Jul 18, 2025 by Pulumi