1. Registry
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. VpcPublicSubnetV2
Viewing docs for selectel 9.5.0
published on Friday, Oct 30, 2026 by selectel
selectel
Viewing docs for selectel 9.5.0
published on Friday, Oct 30, 2026 by selectel

    Creates and manages a public subnet using the v2 public API. For more information about public subnets, see the official Selectel documentation.

    If you are upgrading from a version earlier than 9.1.0, follow the upgrade guide to migrate your resources from the OpenStack provider.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const subnet1 = new selectel.VpcPublicSubnetV2("subnet_1", {
        projectId: project1.id,
        region: "ru-6",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    subnet1 = selectel.VpcPublicSubnetV2("subnet_1",
        project_id=project1["id"],
        region="ru-6")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v9/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewVpcPublicSubnetV2(ctx, "subnet_1", &selectel.VpcPublicSubnetV2Args{
    			ProjectId: pulumi.Any(project1.Id),
    			Region:    pulumi.String("ru-6"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var subnet1 = new Selectel.VpcPublicSubnetV2("subnet_1", new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.VpcPublicSubnetV2;
    import com.pulumi.selectel.VpcPublicSubnetV2Args;
    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 subnet1 = new VpcPublicSubnetV2("subnet1", VpcPublicSubnetV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .build());
    
        }
    }
    
    resources:
      subnet1:
        type: selectel:VpcPublicSubnetV2
        name: subnet_1
        properties:
          projectId: ${project1.id}
          region: ru-6
    
    Example coming soon!
    

    Create VpcPublicSubnetV2 Resource

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

    Constructor syntax

    new VpcPublicSubnetV2(name: string, args: VpcPublicSubnetV2Args, opts?: CustomResourceOptions);
    @overload
    def VpcPublicSubnetV2(resource_name: str,
                          args: VpcPublicSubnetV2Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcPublicSubnetV2(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          project_id: Optional[str] = None,
                          region: Optional[str] = None,
                          ip_version: Optional[str] = None,
                          prefix_length: Optional[float] = None)
    func NewVpcPublicSubnetV2(ctx *Context, name string, args VpcPublicSubnetV2Args, opts ...ResourceOption) (*VpcPublicSubnetV2, error)
    public VpcPublicSubnetV2(string name, VpcPublicSubnetV2Args args, CustomResourceOptions? opts = null)
    public VpcPublicSubnetV2(String name, VpcPublicSubnetV2Args args)
    public VpcPublicSubnetV2(String name, VpcPublicSubnetV2Args args, CustomResourceOptions options)
    
    type: selectel:VpcPublicSubnetV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "selectel_vpc_public_subnet_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VpcPublicSubnetV2Args
    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 VpcPublicSubnetV2Args
    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 VpcPublicSubnetV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcPublicSubnetV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcPublicSubnetV2Args
    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 vpcPublicSubnetV2Resource = new Selectel.VpcPublicSubnetV2("vpcPublicSubnetV2Resource", new()
    {
        ProjectId = "string",
        Region = "string",
        IpVersion = "string",
        PrefixLength = 0.0,
    });
    
    example, err := selectel.NewVpcPublicSubnetV2(ctx, "vpcPublicSubnetV2Resource", &selectel.VpcPublicSubnetV2Args{
    	ProjectId:    pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	IpVersion:    pulumi.String("string"),
    	PrefixLength: pulumi.Float64(0),
    })
    
    resource "selectel_vpc_public_subnet_v2" "vpcPublicSubnetV2Resource" {
      lifecycle {
        create_before_destroy = true
      }
      project_id    = "string"
      region        = "string"
      ip_version    = "string"
      prefix_length = 0
    }
    
    var vpcPublicSubnetV2Resource = new VpcPublicSubnetV2("vpcPublicSubnetV2Resource", VpcPublicSubnetV2Args.builder()
        .projectId("string")
        .region("string")
        .ipVersion("string")
        .prefixLength(0.0)
        .build());
    
    vpc_public_subnet_v2_resource = selectel.VpcPublicSubnetV2("vpcPublicSubnetV2Resource",
        project_id="string",
        region="string",
        ip_version="string",
        prefix_length=float(0))
    
    const vpcPublicSubnetV2Resource = new selectel.VpcPublicSubnetV2("vpcPublicSubnetV2Resource", {
        projectId: "string",
        region: "string",
        ipVersion: "string",
        prefixLength: 0,
    });
    
    type: selectel:VpcPublicSubnetV2
    properties:
        ipVersion: string
        prefixLength: 0
        projectId: string
        region: string
    

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

    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    Region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    PrefixLength double
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    Region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    PrefixLength float64
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    ip_version string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    prefix_length number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region String
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    prefixLength Double
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    ipVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    prefixLength number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region str
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    ip_version str
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    prefix_length float
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region String
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    prefixLength Number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.

    Outputs

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

    Cidr string
    CIDR of the public subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkId string
    Unique identifier of the parent service network.
    Servers List<VpcPublicSubnetV2Server>
    List of cloud servers that are located in the public subnet.
    Status string
    Status of the public subnet.
    SubnetId string
    Unique identifier of the associated subnet in the parent service network.
    Cidr string
    CIDR of the public subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkId string
    Unique identifier of the parent service network.
    Servers []VpcPublicSubnetV2Server
    List of cloud servers that are located in the public subnet.
    Status string
    Status of the public subnet.
    SubnetId string
    Unique identifier of the associated subnet in the parent service network.
    cidr string
    CIDR of the public subnet.
    id string
    The provider-assigned unique ID for this managed resource.
    network_id string
    Unique identifier of the parent service network.
    servers list(object)
    List of cloud servers that are located in the public subnet.
    status string
    Status of the public subnet.
    subnet_id string
    Unique identifier of the associated subnet in the parent service network.
    cidr String
    CIDR of the public subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    networkId String
    Unique identifier of the parent service network.
    servers List<VpcPublicSubnetV2Server>
    List of cloud servers that are located in the public subnet.
    status String
    Status of the public subnet.
    subnetId String
    Unique identifier of the associated subnet in the parent service network.
    cidr string
    CIDR of the public subnet.
    id string
    The provider-assigned unique ID for this managed resource.
    networkId string
    Unique identifier of the parent service network.
    servers VpcPublicSubnetV2Server[]
    List of cloud servers that are located in the public subnet.
    status string
    Status of the public subnet.
    subnetId string
    Unique identifier of the associated subnet in the parent service network.
    cidr str
    CIDR of the public subnet.
    id str
    The provider-assigned unique ID for this managed resource.
    network_id str
    Unique identifier of the parent service network.
    servers Sequence[VpcPublicSubnetV2Server]
    List of cloud servers that are located in the public subnet.
    status str
    Status of the public subnet.
    subnet_id str
    Unique identifier of the associated subnet in the parent service network.
    cidr String
    CIDR of the public subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    networkId String
    Unique identifier of the parent service network.
    servers List<Property Map>
    List of cloud servers that are located in the public subnet.
    status String
    Status of the public subnet.
    subnetId String
    Unique identifier of the associated subnet in the parent service network.

    Look up Existing VpcPublicSubnetV2 Resource

    Get an existing VpcPublicSubnetV2 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?: VpcPublicSubnetV2State, opts?: CustomResourceOptions): VpcPublicSubnetV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr: Optional[str] = None,
            ip_version: Optional[str] = None,
            network_id: Optional[str] = None,
            prefix_length: Optional[float] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            servers: Optional[Sequence[VpcPublicSubnetV2ServerArgs]] = None,
            status: Optional[str] = None,
            subnet_id: Optional[str] = None) -> VpcPublicSubnetV2
    func GetVpcPublicSubnetV2(ctx *Context, name string, id IDInput, state *VpcPublicSubnetV2State, opts ...ResourceOption) (*VpcPublicSubnetV2, error)
    public static VpcPublicSubnetV2 Get(string name, Input<string> id, VpcPublicSubnetV2State? state, CustomResourceOptions? opts = null)
    public static VpcPublicSubnetV2 get(String name, Output<String> id, VpcPublicSubnetV2State state, CustomResourceOptions options)
    resources:  _:    type: selectel:VpcPublicSubnetV2    get:      id: ${id}
    import {
      to = selectel_vpc_public_subnet_v2.example
      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:
    Cidr string
    CIDR of the public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    NetworkId string
    Unique identifier of the parent service network.
    PrefixLength double
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    Region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    Servers List<VpcPublicSubnetV2Server>
    List of cloud servers that are located in the public subnet.
    Status string
    Status of the public subnet.
    SubnetId string
    Unique identifier of the associated subnet in the parent service network.
    Cidr string
    CIDR of the public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    NetworkId string
    Unique identifier of the parent service network.
    PrefixLength float64
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    Region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    Servers []VpcPublicSubnetV2ServerArgs
    List of cloud servers that are located in the public subnet.
    Status string
    Status of the public subnet.
    SubnetId string
    Unique identifier of the associated subnet in the parent service network.
    cidr string
    CIDR of the public subnet.
    ip_version string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    network_id string
    Unique identifier of the parent service network.
    prefix_length number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    servers list(object)
    List of cloud servers that are located in the public subnet.
    status string
    Status of the public subnet.
    subnet_id string
    Unique identifier of the associated subnet in the parent service network.
    cidr String
    CIDR of the public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    networkId String
    Unique identifier of the parent service network.
    prefixLength Double
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region String
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    servers List<VpcPublicSubnetV2Server>
    List of cloud servers that are located in the public subnet.
    status String
    Status of the public subnet.
    subnetId String
    Unique identifier of the associated subnet in the parent service network.
    cidr string
    CIDR of the public subnet.
    ipVersion string
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    networkId string
    Unique identifier of the parent service network.
    prefixLength number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region string
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    servers VpcPublicSubnetV2Server[]
    List of cloud servers that are located in the public subnet.
    status string
    Status of the public subnet.
    subnetId string
    Unique identifier of the associated subnet in the parent service network.
    cidr str
    CIDR of the public subnet.
    ip_version str
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    network_id str
    Unique identifier of the parent service network.
    prefix_length float
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region str
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    servers Sequence[VpcPublicSubnetV2ServerArgs]
    List of cloud servers that are located in the public subnet.
    status str
    Status of the public subnet.
    subnet_id str
    Unique identifier of the associated subnet in the parent service network.
    cidr String
    CIDR of the public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. Available versions are ipv4 or ipv6. Changing this creates a new public subnet. The default value is ipv4.
    networkId String
    Unique identifier of the parent service network.
    prefixLength Number
    Prefix length of the public subnet. Available values are from 24 to 29. Changing this creates a new public subnet. The default value is 29.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new public subnet.
    region String
    Pool where the public subnet is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new public subnet.
    servers List<Property Map>
    List of cloud servers that are located in the public subnet.
    status String
    Status of the public subnet.
    subnetId String
    Unique identifier of the associated subnet in the parent service network.

    Supporting Types

    VpcPublicSubnetV2Server, VpcPublicSubnetV2ServerArgs

    Id string
    Name string
    Status string
    Id string
    Name string
    Status string
    id string
    name string
    status string
    id String
    name String
    status String
    id string
    name string
    status string
    id str
    name str
    status str
    id String
    name String
    status String

    Import

    All versions

    Use the pulumi import command:

    export OS_DOMAIN_NAME=<domain_name>

    export OS_USERNAME=

    export OS_PASSWORD=

    export INFRA_PROJECT_ID=<project_id>

    $ pulumi import selectel:index/vpcPublicSubnetV2:VpcPublicSubnetV2 subnet_1 <id>
    

    <domain_name>, <username>, and <password> are the arguments of the provider configuration.

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

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel
    Viewing docs for selectel 9.5.0
    published on Friday, Oct 30, 2026 by selectel

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial