1. Packages
  2. Opentelekomcloud Provider
  3. API Docs
  4. NetworkingSubnetV2
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

opentelekomcloud.NetworkingSubnetV2

Explore with Pulumi AI

opentelekomcloud logo
opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud

    Up-to-date reference of API arguments for VPC subnet you can get at documentation portal

    Manages a V2 Neutron subnet resource within OpenTelekomCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opentelekomcloud from "@pulumi/opentelekomcloud";
    
    const network1 = new opentelekomcloud.NetworkingNetworkV2("network1", {adminStateUp: "true"});
    const subnet1 = new opentelekomcloud.NetworkingSubnetV2("subnet1", {
        networkId: network1.networkingNetworkV2Id,
        cidr: "192.168.199.0/24",
    });
    
    import pulumi
    import pulumi_opentelekomcloud as opentelekomcloud
    
    network1 = opentelekomcloud.NetworkingNetworkV2("network1", admin_state_up="true")
    subnet1 = opentelekomcloud.NetworkingSubnetV2("subnet1",
        network_id=network1.networking_network_v2_id,
        cidr="192.168.199.0/24")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		network1, err := opentelekomcloud.NewNetworkingNetworkV2(ctx, "network1", &opentelekomcloud.NetworkingNetworkV2Args{
    			AdminStateUp: pulumi.String("true"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opentelekomcloud.NewNetworkingSubnetV2(ctx, "subnet1", &opentelekomcloud.NetworkingSubnetV2Args{
    			NetworkId: network1.NetworkingNetworkV2Id,
    			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 Opentelekomcloud = Pulumi.Opentelekomcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var network1 = new Opentelekomcloud.NetworkingNetworkV2("network1", new()
        {
            AdminStateUp = "true",
        });
    
        var subnet1 = new Opentelekomcloud.NetworkingSubnetV2("subnet1", new()
        {
            NetworkId = network1.NetworkingNetworkV2Id,
            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.opentelekomcloud.NetworkingNetworkV2;
    import com.pulumi.opentelekomcloud.NetworkingNetworkV2Args;
    import com.pulumi.opentelekomcloud.NetworkingSubnetV2;
    import com.pulumi.opentelekomcloud.NetworkingSubnetV2Args;
    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 NetworkingNetworkV2("network1", NetworkingNetworkV2Args.builder()
                .adminStateUp("true")
                .build());
    
            var subnet1 = new NetworkingSubnetV2("subnet1", NetworkingSubnetV2Args.builder()
                .networkId(network1.networkingNetworkV2Id())
                .cidr("192.168.199.0/24")
                .build());
    
        }
    }
    
    resources:
      network1:
        type: opentelekomcloud:NetworkingNetworkV2
        properties:
          adminStateUp: 'true'
      subnet1:
        type: opentelekomcloud:NetworkingSubnetV2
        properties:
          networkId: ${network1.networkingNetworkV2Id}
          cidr: 192.168.199.0/24
    

    Create NetworkingSubnetV2 Resource

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

    Constructor syntax

    new NetworkingSubnetV2(name: string, args: NetworkingSubnetV2Args, opts?: CustomResourceOptions);
    @overload
    def NetworkingSubnetV2(resource_name: str,
                           args: NetworkingSubnetV2Args,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkingSubnetV2(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           network_id: Optional[str] = None,
                           cidr: Optional[str] = None,
                           ip_version: Optional[float] = None,
                           enable_dhcp: Optional[bool] = None,
                           gateway_ip: Optional[str] = None,
                           host_routes: Optional[Sequence[NetworkingSubnetV2HostRouteArgs]] = None,
                           allocation_pools: Optional[Sequence[NetworkingSubnetV2AllocationPoolArgs]] = None,
                           name: Optional[str] = None,
                           dns_nameservers: Optional[Sequence[str]] = None,
                           networking_subnet_v2_id: Optional[str] = None,
                           no_gateway: Optional[bool] = None,
                           region: Optional[str] = None,
                           tenant_id: Optional[str] = None,
                           timeouts: Optional[NetworkingSubnetV2TimeoutsArgs] = None,
                           value_specs: Optional[Mapping[str, str]] = None)
    func NewNetworkingSubnetV2(ctx *Context, name string, args NetworkingSubnetV2Args, opts ...ResourceOption) (*NetworkingSubnetV2, error)
    public NetworkingSubnetV2(string name, NetworkingSubnetV2Args args, CustomResourceOptions? opts = null)
    public NetworkingSubnetV2(String name, NetworkingSubnetV2Args args)
    public NetworkingSubnetV2(String name, NetworkingSubnetV2Args args, CustomResourceOptions options)
    
    type: opentelekomcloud:NetworkingSubnetV2
    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 NetworkingSubnetV2Args
    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 NetworkingSubnetV2Args
    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 NetworkingSubnetV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkingSubnetV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkingSubnetV2Args
    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 networkingSubnetV2Resource = new Opentelekomcloud.NetworkingSubnetV2("networkingSubnetV2Resource", new()
    {
        NetworkId = "string",
        Cidr = "string",
        IpVersion = 0,
        EnableDhcp = false,
        GatewayIp = "string",
        HostRoutes = new[]
        {
            new Opentelekomcloud.Inputs.NetworkingSubnetV2HostRouteArgs
            {
                DestinationCidr = "string",
                NextHop = "string",
            },
        },
        AllocationPools = new[]
        {
            new Opentelekomcloud.Inputs.NetworkingSubnetV2AllocationPoolArgs
            {
                End = "string",
                Start = "string",
            },
        },
        Name = "string",
        DnsNameservers = new[]
        {
            "string",
        },
        NetworkingSubnetV2Id = "string",
        NoGateway = false,
        Region = "string",
        TenantId = "string",
        Timeouts = new Opentelekomcloud.Inputs.NetworkingSubnetV2TimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
        ValueSpecs = 
        {
            { "string", "string" },
        },
    });
    
    example, err := opentelekomcloud.NewNetworkingSubnetV2(ctx, "networkingSubnetV2Resource", &opentelekomcloud.NetworkingSubnetV2Args{
    	NetworkId:  pulumi.String("string"),
    	Cidr:       pulumi.String("string"),
    	IpVersion:  pulumi.Float64(0),
    	EnableDhcp: pulumi.Bool(false),
    	GatewayIp:  pulumi.String("string"),
    	HostRoutes: opentelekomcloud.NetworkingSubnetV2HostRouteArray{
    		&opentelekomcloud.NetworkingSubnetV2HostRouteArgs{
    			DestinationCidr: pulumi.String("string"),
    			NextHop:         pulumi.String("string"),
    		},
    	},
    	AllocationPools: opentelekomcloud.NetworkingSubnetV2AllocationPoolArray{
    		&opentelekomcloud.NetworkingSubnetV2AllocationPoolArgs{
    			End:   pulumi.String("string"),
    			Start: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    	DnsNameservers: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	NetworkingSubnetV2Id: pulumi.String("string"),
    	NoGateway:            pulumi.Bool(false),
    	Region:               pulumi.String("string"),
    	TenantId:             pulumi.String("string"),
    	Timeouts: &opentelekomcloud.NetworkingSubnetV2TimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    	ValueSpecs: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var networkingSubnetV2Resource = new NetworkingSubnetV2("networkingSubnetV2Resource", NetworkingSubnetV2Args.builder()
        .networkId("string")
        .cidr("string")
        .ipVersion(0)
        .enableDhcp(false)
        .gatewayIp("string")
        .hostRoutes(NetworkingSubnetV2HostRouteArgs.builder()
            .destinationCidr("string")
            .nextHop("string")
            .build())
        .allocationPools(NetworkingSubnetV2AllocationPoolArgs.builder()
            .end("string")
            .start("string")
            .build())
        .name("string")
        .dnsNameservers("string")
        .networkingSubnetV2Id("string")
        .noGateway(false)
        .region("string")
        .tenantId("string")
        .timeouts(NetworkingSubnetV2TimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .valueSpecs(Map.of("string", "string"))
        .build());
    
    networking_subnet_v2_resource = opentelekomcloud.NetworkingSubnetV2("networkingSubnetV2Resource",
        network_id="string",
        cidr="string",
        ip_version=0,
        enable_dhcp=False,
        gateway_ip="string",
        host_routes=[{
            "destination_cidr": "string",
            "next_hop": "string",
        }],
        allocation_pools=[{
            "end": "string",
            "start": "string",
        }],
        name="string",
        dns_nameservers=["string"],
        networking_subnet_v2_id="string",
        no_gateway=False,
        region="string",
        tenant_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        },
        value_specs={
            "string": "string",
        })
    
    const networkingSubnetV2Resource = new opentelekomcloud.NetworkingSubnetV2("networkingSubnetV2Resource", {
        networkId: "string",
        cidr: "string",
        ipVersion: 0,
        enableDhcp: false,
        gatewayIp: "string",
        hostRoutes: [{
            destinationCidr: "string",
            nextHop: "string",
        }],
        allocationPools: [{
            end: "string",
            start: "string",
        }],
        name: "string",
        dnsNameservers: ["string"],
        networkingSubnetV2Id: "string",
        noGateway: false,
        region: "string",
        tenantId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
        valueSpecs: {
            string: "string",
        },
    });
    
    type: opentelekomcloud:NetworkingSubnetV2
    properties:
        allocationPools:
            - end: string
              start: string
        cidr: string
        dnsNameservers:
            - string
        enableDhcp: false
        gatewayIp: string
        hostRoutes:
            - destinationCidr: string
              nextHop: string
        ipVersion: 0
        name: string
        networkId: string
        networkingSubnetV2Id: string
        noGateway: false
        region: string
        tenantId: string
        timeouts:
            create: string
            delete: string
        valueSpecs:
            string: string
    

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

    Cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    NetworkId string
    The UUID of the parent network. Changing this creates a new subnet.
    AllocationPools List<NetworkingSubnetV2AllocationPool>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    HostRoutes List<NetworkingSubnetV2HostRoute>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    IpVersion double
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    Name string
    The name of the subnet. Changing this updates the name of the existing subnet.
    NetworkingSubnetV2Id string
    NoGateway bool
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    Region string
    TenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    Timeouts NetworkingSubnetV2Timeouts
    ValueSpecs Dictionary<string, string>
    Map of additional options.
    Cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    NetworkId string
    The UUID of the parent network. Changing this creates a new subnet.
    AllocationPools []NetworkingSubnetV2AllocationPoolArgs
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    HostRoutes []NetworkingSubnetV2HostRouteArgs
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    IpVersion float64
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    Name string
    The name of the subnet. Changing this updates the name of the existing subnet.
    NetworkingSubnetV2Id string
    NoGateway bool
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    Region string
    TenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    Timeouts NetworkingSubnetV2TimeoutsArgs
    ValueSpecs map[string]string
    Map of additional options.
    cidr String
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    networkId String
    The UUID of the parent network. Changing this creates a new subnet.
    allocationPools List<NetworkingSubnetV2AllocationPool>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes List<NetworkingSubnetV2HostRoute>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion Double
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    name String
    The name of the subnet. Changing this updates the name of the existing subnet.
    networkingSubnetV2Id String
    noGateway Boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region String
    tenantId String
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts NetworkingSubnetV2Timeouts
    valueSpecs Map<String,String>
    Map of additional options.
    cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    networkId string
    The UUID of the parent network. Changing this creates a new subnet.
    allocationPools NetworkingSubnetV2AllocationPool[]
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes NetworkingSubnetV2HostRoute[]
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion number
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    name string
    The name of the subnet. Changing this updates the name of the existing subnet.
    networkingSubnetV2Id string
    noGateway boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region string
    tenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts NetworkingSubnetV2Timeouts
    valueSpecs {[key: string]: string}
    Map of additional options.
    cidr str
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    network_id str
    The UUID of the parent network. Changing this creates a new subnet.
    allocation_pools Sequence[NetworkingSubnetV2AllocationPoolArgs]
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    host_routes Sequence[NetworkingSubnetV2HostRouteArgs]
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ip_version float
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    name str
    The name of the subnet. Changing this updates the name of the existing subnet.
    networking_subnet_v2_id str
    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.
    region str
    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.
    timeouts NetworkingSubnetV2TimeoutsArgs
    value_specs Mapping[str, str]
    Map of additional options.
    cidr String
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new subnet.
    networkId String
    The UUID of the parent network. Changing this creates a new subnet.
    allocationPools List<Property Map>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes List<Property Map>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion Number
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    name String
    The name of the subnet. Changing this updates the name of the existing subnet.
    networkingSubnetV2Id String
    noGateway Boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region String
    tenantId String
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts Property Map
    valueSpecs Map<String>
    Map of additional options.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing NetworkingSubnetV2 Resource

    Get an existing NetworkingSubnetV2 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?: NetworkingSubnetV2State, opts?: CustomResourceOptions): NetworkingSubnetV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allocation_pools: Optional[Sequence[NetworkingSubnetV2AllocationPoolArgs]] = None,
            cidr: Optional[str] = None,
            dns_nameservers: Optional[Sequence[str]] = None,
            enable_dhcp: Optional[bool] = None,
            gateway_ip: Optional[str] = None,
            host_routes: Optional[Sequence[NetworkingSubnetV2HostRouteArgs]] = None,
            ip_version: Optional[float] = None,
            name: Optional[str] = None,
            network_id: Optional[str] = None,
            networking_subnet_v2_id: Optional[str] = None,
            no_gateway: Optional[bool] = None,
            region: Optional[str] = None,
            tenant_id: Optional[str] = None,
            timeouts: Optional[NetworkingSubnetV2TimeoutsArgs] = None,
            value_specs: Optional[Mapping[str, str]] = None) -> NetworkingSubnetV2
    func GetNetworkingSubnetV2(ctx *Context, name string, id IDInput, state *NetworkingSubnetV2State, opts ...ResourceOption) (*NetworkingSubnetV2, error)
    public static NetworkingSubnetV2 Get(string name, Input<string> id, NetworkingSubnetV2State? state, CustomResourceOptions? opts = null)
    public static NetworkingSubnetV2 get(String name, Output<String> id, NetworkingSubnetV2State state, CustomResourceOptions options)
    resources:  _:    type: opentelekomcloud:NetworkingSubnetV2    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:
    AllocationPools List<NetworkingSubnetV2AllocationPool>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    Cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    HostRoutes List<NetworkingSubnetV2HostRoute>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    IpVersion double
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    NetworkingSubnetV2Id string
    NoGateway bool
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    Region string
    TenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    Timeouts NetworkingSubnetV2Timeouts
    ValueSpecs Dictionary<string, string>
    Map of additional options.
    AllocationPools []NetworkingSubnetV2AllocationPoolArgs
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    Cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    HostRoutes []NetworkingSubnetV2HostRouteArgs
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    IpVersion float64
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    NetworkingSubnetV2Id string
    NoGateway bool
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    Region string
    TenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    Timeouts NetworkingSubnetV2TimeoutsArgs
    ValueSpecs map[string]string
    Map of additional options.
    allocationPools List<NetworkingSubnetV2AllocationPool>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    cidr String
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes List<NetworkingSubnetV2HostRoute>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion Double
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    networkingSubnetV2Id String
    noGateway Boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region String
    tenantId String
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts NetworkingSubnetV2Timeouts
    valueSpecs Map<String,String>
    Map of additional options.
    allocationPools NetworkingSubnetV2AllocationPool[]
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    cidr string
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes NetworkingSubnetV2HostRoute[]
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion number
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    networkingSubnetV2Id string
    noGateway boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region string
    tenantId string
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts NetworkingSubnetV2Timeouts
    valueSpecs {[key: string]: string}
    Map of additional options.
    allocation_pools Sequence[NetworkingSubnetV2AllocationPoolArgs]
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    cidr str
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    host_routes Sequence[NetworkingSubnetV2HostRouteArgs]
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ip_version float
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    networking_subnet_v2_id str
    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.
    region str
    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.
    timeouts NetworkingSubnetV2TimeoutsArgs
    value_specs Mapping[str, str]
    Map of additional options.
    allocationPools List<Property Map>
    An array of sub-ranges of CIDR available for dynamic allocation to ports. The allocation_pool object structure is documented below. Changing this creates a new subnet.
    cidr String
    CIDR representing IP range for this subnet, based on IP version. Changing this creates a new 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. Default value is ["100.125.4.25", "100.125.129.199"]
    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_gateway will cause a default gateway of .1 to be used. Changing this updates the gateway IP of the existing subnet.
    hostRoutes List<Property Map>
    An array of routes that should be used by devices with IPs from this subnet (not including local subnet route). The host_route object structure is documented below. Changing this updates the host routes for the existing subnet.
    ipVersion Number
    IP version, either 4 (default) or 6. Changing this creates a new subnet.
    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.
    networkingSubnetV2Id String
    noGateway Boolean
    Do not set a gateway IP on this subnet. Changing this removes or adds a default gateway IP of the existing subnet.
    region String
    tenantId String
    The owner of the subnet. Required if admin wants to create a subnet for another tenant. Changing this creates a new subnet.
    timeouts Property Map
    valueSpecs Map<String>
    Map of additional options.

    Supporting Types

    NetworkingSubnetV2AllocationPool, NetworkingSubnetV2AllocationPoolArgs

    End string
    The ending address.
    Start string
    The starting address.
    End string
    The ending address.
    Start string
    The starting address.
    end String
    The ending address.
    start String
    The starting address.
    end string
    The ending address.
    start string
    The starting address.
    end str
    The ending address.
    start str
    The starting address.
    end String
    The ending address.
    start String
    The starting address.

    NetworkingSubnetV2HostRoute, NetworkingSubnetV2HostRouteArgs

    DestinationCidr string
    The destination CIDR.
    NextHop string
    The next hop in the route.
    DestinationCidr string
    The destination CIDR.
    NextHop string
    The next hop in the route.
    destinationCidr String
    The destination CIDR.
    nextHop String
    The next hop in the route.
    destinationCidr string
    The destination CIDR.
    nextHop string
    The next hop in the route.
    destination_cidr str
    The destination CIDR.
    next_hop str
    The next hop in the route.
    destinationCidr String
    The destination CIDR.
    nextHop String
    The next hop in the route.

    NetworkingSubnetV2Timeouts, NetworkingSubnetV2TimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

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

    $ pulumi import opentelekomcloud:index/networkingSubnetV2:NetworkingSubnetV2 subnet_1 da4faf16-5546-41e4-8330-4d0002b74048
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
    License
    Notes
    This Pulumi package is based on the opentelekomcloud Terraform Provider.
    opentelekomcloud logo
    opentelekomcloud 1.36.37 published on Thursday, Apr 24, 2025 by opentelekomcloud