openstack.networking.Subnet
Manages a V2 Neutron subnet 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: "tf_test_network",
    adminStateUp: true,
});
const subnet1 = new openstack.networking.Subnet("subnet_1", {
    networkId: network1.id,
    cidr: "192.168.199.0/24",
});
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network_1",
    name="tf_test_network",
    admin_state_up=True)
subnet1 = openstack.networking.Subnet("subnet_1",
    network_id=network1.id,
    cidr="192.168.199.0/24")
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 {
		network1, err := networking.NewNetwork(ctx, "network_1", &networking.NetworkArgs{
			Name:         pulumi.String("tf_test_network"),
			AdminStateUp: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = networking.NewSubnet(ctx, "subnet_1", &networking.SubnetArgs{
			NetworkId: network1.ID(),
			Cidr:      pulumi.String("192.168.199.0/24"),
		})
		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 = "tf_test_network",
        AdminStateUp = true,
    });
    var subnet1 = new OpenStack.Networking.Subnet("subnet_1", new()
    {
        NetworkId = network1.Id,
        Cidr = "192.168.199.0/24",
    });
});
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 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("tf_test_network")
            .adminStateUp(true)
            .build());
        var subnet1 = new Subnet("subnet1", SubnetArgs.builder()
            .networkId(network1.id())
            .cidr("192.168.199.0/24")
            .build());
    }
}
resources:
  network1:
    type: openstack:networking:Network
    name: network_1
    properties:
      name: tf_test_network
      adminStateUp: 'true'
  subnet1:
    type: openstack:networking:Subnet
    name: subnet_1
    properties:
      networkId: ${network1.id}
      cidr: 192.168.199.0/24
Create Subnet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Subnet(name: string, args: SubnetArgs, opts?: CustomResourceOptions);@overload
def Subnet(resource_name: str,
           args: SubnetArgs,
           opts: Optional[ResourceOptions] = None)
@overload
def Subnet(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           network_id: Optional[str] = None,
           name: Optional[str] = None,
           description: Optional[str] = None,
           dns_nameservers: Optional[Sequence[str]] = None,
           dns_publish_fixed_ip: Optional[bool] = None,
           enable_dhcp: Optional[bool] = None,
           gateway_ip: Optional[str] = None,
           ip_version: Optional[int] = None,
           ipv6_address_mode: Optional[str] = None,
           allocation_pools: Optional[Sequence[SubnetAllocationPoolArgs]] = None,
           ipv6_ra_mode: Optional[str] = None,
           prefix_length: Optional[int] = None,
           no_gateway: Optional[bool] = None,
           cidr: Optional[str] = None,
           region: Optional[str] = None,
           segment_id: Optional[str] = None,
           service_types: Optional[Sequence[str]] = None,
           subnetpool_id: Optional[str] = None,
           tags: Optional[Sequence[str]] = None,
           tenant_id: Optional[str] = None,
           value_specs: Optional[Mapping[str, str]] = None)func NewSubnet(ctx *Context, name string, args SubnetArgs, opts ...ResourceOption) (*Subnet, error)public Subnet(string name, SubnetArgs args, CustomResourceOptions? opts = null)
public Subnet(String name, SubnetArgs args)
public Subnet(String name, SubnetArgs args, CustomResourceOptions options)
type: openstack:networking:Subnet
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 SubnetArgs
- 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 SubnetArgs
- 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 SubnetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SubnetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SubnetArgs
- 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 subnetResource = new OpenStack.Networking.Subnet("subnetResource", new()
{
    NetworkId = "string",
    Name = "string",
    Description = "string",
    DnsNameservers = new[]
    {
        "string",
    },
    DnsPublishFixedIp = false,
    EnableDhcp = false,
    GatewayIp = "string",
    IpVersion = 0,
    Ipv6AddressMode = "string",
    AllocationPools = new[]
    {
        new OpenStack.Networking.Inputs.SubnetAllocationPoolArgs
        {
            End = "string",
            Start = "string",
        },
    },
    Ipv6RaMode = "string",
    PrefixLength = 0,
    NoGateway = false,
    Cidr = "string",
    Region = "string",
    SegmentId = "string",
    ServiceTypes = new[]
    {
        "string",
    },
    SubnetpoolId = "string",
    Tags = new[]
    {
        "string",
    },
    TenantId = "string",
    ValueSpecs = 
    {
        { "string", "string" },
    },
});
example, err := networking.NewSubnet(ctx, "subnetResource", &networking.SubnetArgs{
	NetworkId:   pulumi.String("string"),
	Name:        pulumi.String("string"),
	Description: pulumi.String("string"),
	DnsNameservers: pulumi.StringArray{
		pulumi.String("string"),
	},
	DnsPublishFixedIp: pulumi.Bool(false),
	EnableDhcp:        pulumi.Bool(false),
	GatewayIp:         pulumi.String("string"),
	IpVersion:         pulumi.Int(0),
	Ipv6AddressMode:   pulumi.String("string"),
	AllocationPools: networking.SubnetAllocationPoolArray{
		&networking.SubnetAllocationPoolArgs{
			End:   pulumi.String("string"),
			Start: pulumi.String("string"),
		},
	},
	Ipv6RaMode:   pulumi.String("string"),
	PrefixLength: pulumi.Int(0),
	NoGateway:    pulumi.Bool(false),
	Cidr:         pulumi.String("string"),
	Region:       pulumi.String("string"),
	SegmentId:    pulumi.String("string"),
	ServiceTypes: pulumi.StringArray{
		pulumi.String("string"),
	},
	SubnetpoolId: pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
	TenantId: pulumi.String("string"),
	ValueSpecs: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var subnetResource = new Subnet("subnetResource", SubnetArgs.builder()
    .networkId("string")
    .name("string")
    .description("string")
    .dnsNameservers("string")
    .dnsPublishFixedIp(false)
    .enableDhcp(false)
    .gatewayIp("string")
    .ipVersion(0)
    .ipv6AddressMode("string")
    .allocationPools(SubnetAllocationPoolArgs.builder()
        .end("string")
        .start("string")
        .build())
    .ipv6RaMode("string")
    .prefixLength(0)
    .noGateway(false)
    .cidr("string")
    .region("string")
    .segmentId("string")
    .serviceTypes("string")
    .subnetpoolId("string")
    .tags("string")
    .tenantId("string")
    .valueSpecs(Map.of("string", "string"))
    .build());
subnet_resource = openstack.networking.Subnet("subnetResource",
    network_id="string",
    name="string",
    description="string",
    dns_nameservers=["string"],
    dns_publish_fixed_ip=False,
    enable_dhcp=False,
    gateway_ip="string",
    ip_version=0,
    ipv6_address_mode="string",
    allocation_pools=[{
        "end": "string",
        "start": "string",
    }],
    ipv6_ra_mode="string",
    prefix_length=0,
    no_gateway=False,
    cidr="string",
    region="string",
    segment_id="string",
    service_types=["string"],
    subnetpool_id="string",
    tags=["string"],
    tenant_id="string",
    value_specs={
        "string": "string",
    })
const subnetResource = new openstack.networking.Subnet("subnetResource", {
    networkId: "string",
    name: "string",
    description: "string",
    dnsNameservers: ["string"],
    dnsPublishFixedIp: false,
    enableDhcp: false,
    gatewayIp: "string",
    ipVersion: 0,
    ipv6AddressMode: "string",
    allocationPools: [{
        end: "string",
        start: "string",
    }],
    ipv6RaMode: "string",
    prefixLength: 0,
    noGateway: false,
    cidr: "string",
    region: "string",
    segmentId: "string",
    serviceTypes: ["string"],
    subnetpoolId: "string",
    tags: ["string"],
    tenantId: "string",
    valueSpecs: {
        string: "string",
    },
});
type: openstack:networking:Subnet
properties:
    allocationPools:
        - end: string
          start: string
    cidr: string
    description: string
    dnsNameservers:
        - string
    dnsPublishFixedIp: false
    enableDhcp: false
    gatewayIp: string
    ipVersion: 0
    ipv6AddressMode: string
    ipv6RaMode: string
    name: string
    networkId: string
    noGateway: false
    prefixLength: 0
    region: string
    segmentId: string
    serviceTypes:
        - string
    subnetpoolId: string
    tags:
        - string
    tenantId: string
    valueSpecs:
        string: string
Subnet 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 Subnet resource accepts the following input properties:
- NetworkId string
- The UUID of the parent network. Changing this creates a new subnet.
- AllocationPools List<Pulumi.Open Stack. Networking. Inputs. Subnet Allocation Pool> 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- Cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- Description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- DnsNameservers List<string>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- DnsPublish boolFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- EnableDhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- GatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- IpVersion int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- Ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- NoGateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- PrefixLength int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- Region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- SegmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- ServiceTypes List<string>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- SubnetpoolId string
- The ID of the subnetpool associated with the subnet.
- List<string>
- A set of string tags for the subnet.
- TenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- ValueSpecs Dictionary<string, string>
- Map of additional options.
- NetworkId string
- The UUID of the parent network. Changing this creates a new subnet.
- AllocationPools []SubnetAllocation Pool Args 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- Cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- Description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- DnsNameservers []string
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- DnsPublish boolFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- EnableDhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- GatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- IpVersion int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- Ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- NoGateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- PrefixLength int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- Region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- SegmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- ServiceTypes []string
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- SubnetpoolId string
- The ID of the subnetpool associated with the subnet.
- []string
- A set of string tags for the subnet.
- TenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- ValueSpecs map[string]string
- Map of additional options.
- networkId String
- The UUID of the parent network. Changing this creates a new subnet.
- allocationPools List<SubnetAllocation Pool> 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr String
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description String
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers List<String>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish BooleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp Boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp String
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion Integer
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode String
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode String
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name String
- The name of the subnet. Changing this updates the name of the existing subnet.
- noGateway Boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength Integer
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region String
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId String
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes List<String>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId String
- The ID of the subnetpool associated with the subnet.
- List<String>
- A set of string tags for the subnet.
- tenantId String
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs Map<String,String>
- Map of additional options.
- networkId string
- The UUID of the parent network. Changing this creates a new subnet.
- allocationPools SubnetAllocation Pool[] 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers string[]
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish booleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion number
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- noGateway boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength number
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes string[]
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId string
- The ID of the subnetpool associated with the subnet.
- string[]
- A set of string tags for the subnet.
- tenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs {[key: string]: string}
- Map of additional options.
- network_id str
- The UUID of the parent network. Changing this creates a new subnet.
- allocation_pools Sequence[SubnetAllocation Pool Args] 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr str
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description str
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dns_nameservers Sequence[str]
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dns_publish_ boolfixed_ ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enable_dhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gateway_ip str
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ip_version int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6_address_ strmode 
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6_ra_ strmode 
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name str
- The name of the subnet. Changing this updates the name of the existing subnet.
- no_gateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefix_length int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region str
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segment_id str
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- service_types Sequence[str]
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpool_id str
- The ID of the subnetpool associated with the subnet.
- Sequence[str]
- A set of string tags for the subnet.
- tenant_id str
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- value_specs Mapping[str, str]
- Map of additional options.
- networkId String
- The UUID of the parent network. Changing this creates a new subnet.
- allocationPools List<Property Map>
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr String
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description String
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers List<String>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish BooleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp Boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp String
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion Number
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode String
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode String
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name String
- The name of the subnet. Changing this updates the name of the existing subnet.
- noGateway Boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength Number
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region String
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId String
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes List<String>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId String
- The ID of the subnetpool associated with the subnet.
- List<String>
- A set of string tags for the subnet.
- tenantId String
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs Map<String>
- Map of additional options.
Outputs
All input properties are implicitly available as output properties. Additionally, the Subnet resource produces the following output properties:
- List<string>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- Id string
- The provider-assigned unique ID for this managed resource.
- []string
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- Id string
- The provider-assigned unique ID for this managed resource.
- List<String>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- id String
- The provider-assigned unique ID for this managed resource.
- string[]
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- id string
- The provider-assigned unique ID for this managed resource.
- Sequence[str]
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- id str
- The provider-assigned unique ID for this managed resource.
- List<String>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Subnet Resource
Get an existing Subnet 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?: SubnetState, opts?: CustomResourceOptions): Subnet@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        all_tags: Optional[Sequence[str]] = None,
        allocation_pools: Optional[Sequence[SubnetAllocationPoolArgs]] = None,
        cidr: Optional[str] = None,
        description: Optional[str] = None,
        dns_nameservers: Optional[Sequence[str]] = None,
        dns_publish_fixed_ip: Optional[bool] = None,
        enable_dhcp: Optional[bool] = None,
        gateway_ip: Optional[str] = None,
        ip_version: Optional[int] = None,
        ipv6_address_mode: Optional[str] = None,
        ipv6_ra_mode: Optional[str] = None,
        name: Optional[str] = None,
        network_id: Optional[str] = None,
        no_gateway: Optional[bool] = None,
        prefix_length: Optional[int] = None,
        region: Optional[str] = None,
        segment_id: Optional[str] = None,
        service_types: Optional[Sequence[str]] = None,
        subnetpool_id: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        tenant_id: Optional[str] = None,
        value_specs: Optional[Mapping[str, str]] = None) -> Subnetfunc GetSubnet(ctx *Context, name string, id IDInput, state *SubnetState, opts ...ResourceOption) (*Subnet, error)public static Subnet Get(string name, Input<string> id, SubnetState? state, CustomResourceOptions? opts = null)public static Subnet get(String name, Output<String> id, SubnetState state, CustomResourceOptions options)resources:  _:    type: openstack:networking:Subnet    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.
- List<string>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- AllocationPools List<Pulumi.Open Stack. Networking. Inputs. Subnet Allocation Pool> 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- Cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- Description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- DnsNameservers List<string>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- DnsPublish boolFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- EnableDhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- GatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- IpVersion int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- Ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- NetworkId string
- The UUID of the parent network. Changing this creates a new subnet.
- NoGateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- PrefixLength int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- Region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- SegmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- ServiceTypes List<string>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- SubnetpoolId string
- The ID of the subnetpool associated with the subnet.
- List<string>
- A set of string tags for the subnet.
- TenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- ValueSpecs Dictionary<string, string>
- Map of additional options.
- []string
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- AllocationPools []SubnetAllocation Pool Args 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- Cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- Description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- DnsNameservers []string
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- DnsPublish boolFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- EnableDhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- GatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- IpVersion int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- Ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- Name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- NetworkId string
- The UUID of the parent network. Changing this creates a new subnet.
- NoGateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- PrefixLength int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- Region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- SegmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- ServiceTypes []string
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- SubnetpoolId string
- The ID of the subnetpool associated with the subnet.
- []string
- A set of string tags for the subnet.
- TenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- ValueSpecs map[string]string
- Map of additional options.
- List<String>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- allocationPools List<SubnetAllocation Pool> 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr String
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description String
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers List<String>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish BooleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp Boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp String
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion Integer
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode String
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode String
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name String
- The name of the subnet. Changing this updates the name of the existing subnet.
- networkId String
- The UUID of the parent network. Changing this creates a new subnet.
- noGateway Boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength Integer
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region String
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId String
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes List<String>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId String
- The ID of the subnetpool associated with the subnet.
- List<String>
- A set of string tags for the subnet.
- tenantId String
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs Map<String,String>
- Map of additional options.
- string[]
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- allocationPools SubnetAllocation Pool[] 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr string
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description string
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers string[]
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish booleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp string
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion number
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode string
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode string
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name string
- The name of the subnet. Changing this updates the name of the existing subnet.
- networkId string
- The UUID of the parent network. Changing this creates a new subnet.
- noGateway boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength number
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region string
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId string
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes string[]
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId string
- The ID of the subnetpool associated with the subnet.
- string[]
- A set of string tags for the subnet.
- tenantId string
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs {[key: string]: string}
- Map of additional options.
- Sequence[str]
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- allocation_pools Sequence[SubnetAllocation Pool Args] 
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr str
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description str
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dns_nameservers Sequence[str]
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dns_publish_ boolfixed_ ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enable_dhcp bool
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gateway_ip str
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ip_version int
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6_address_ strmode 
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6_ra_ strmode 
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name str
- The name of the subnet. Changing this updates the name of the existing subnet.
- network_id str
- The UUID of the parent network. Changing this creates a new subnet.
- no_gateway bool
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefix_length int
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region str
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segment_id str
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- service_types Sequence[str]
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpool_id str
- The ID of the subnetpool associated with the subnet.
- Sequence[str]
- A set of string tags for the subnet.
- tenant_id str
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- value_specs Mapping[str, str]
- Map of additional options.
- List<String>
- The collection of ags assigned on the subnet, which have been explicitly and implicitly added.
- allocationPools List<Property Map>
- A block declaring the start and end range of
the IP addresses available for use with DHCP in this subnet. Multiple
allocation_poolblocks can be declared, providing the subnet with more than one range of IP addresses to use with DHCP. However, each IP range must be from the same CIDR that the subnet is part of. Theallocation_poolblock is documented below.
- cidr String
- CIDR representing IP range for this subnet, based on IP version. You can omit this option if you are creating a subnet from a subnet pool.
- description String
- Human-readable description of the subnet. Changing this updates the name of the existing subnet.
- dnsNameservers List<String>
- An array of DNS name server names used by hosts in this subnet. Changing this updates the DNS name servers for the existing subnet.
- dnsPublish BooleanFixed Ip 
- Whether to publish DNS records for IPs from this subnet. Defaults is false.
- enableDhcp Boolean
- The administrative state of the network. Acceptable values are "true" and "false". Changing this value enables or disables the DHCP capabilities of the existing subnet. Defaults to true.
- gatewayIp String
- Default gateway used by devices in this subnet.
Leaving this blank and not setting no_gatewaywill cause a default gateway of.1to be used. Changing this updates the gateway IP of the existing subnet.
- ipVersion Number
- IP version, either 4 (default) or 6. Changing this creates a new subnet.
- ipv6AddressMode String
- The IPv6 address mode. Valid values are
dhcpv6-stateful,dhcpv6-stateless, orslaac.
- ipv6RaMode String
- The IPv6 Router Advertisement mode. Valid values
are dhcpv6-stateful,dhcpv6-stateless, orslaac.
- name String
- The name of the subnet. Changing this updates the name of the existing subnet.
- networkId String
- The UUID of the parent network. Changing this creates a new subnet.
- noGateway Boolean
- Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
- prefixLength Number
- The prefix length to use when creating a subnet from a subnet pool. The default subnet pool prefix length that was defined when creating the subnet pool will be used if not provided. Changing this creates a new subnet.
- region String
- The region in which to obtain the V2 Networking client.
A Networking client is needed to create a Neutron subnet. If omitted, the
regionargument of the provider is used. Changing this creates a new subnet.
- segmentId String
- The segment ID of the subnet. This is used to specify which segment the subnet belongs to when using Neutron's routed provider networks. Available when neutron segment extension is enabled.
- serviceTypes List<String>
- An array of service types used by the subnet. Changing this updates the service types for the existing subnet.
- subnetpoolId String
- The ID of the subnetpool associated with the subnet.
- List<String>
- A set of string tags for the subnet.
- tenantId String
- The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
- valueSpecs Map<String>
- Map of additional options.
Supporting Types
SubnetAllocationPool, SubnetAllocationPoolArgs      
Import
Subnets can be imported using the id, e.g.
$ pulumi import openstack:networking/subnet:Subnet subnet_1 da4faf16-5546-41e4-8330-4d0002b74048
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 openstackTerraform Provider.
