1. Packages
  2. Selectel Provider
  3. API Docs
  4. VpcSubnetV2
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

selectel.VpcSubnetV2

Explore with Pulumi AI

selectel logo
selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const subnet1 = new selectel.VpcSubnetV2("subnet1", {
        projectId: selectel_vpc_project_v2.project_1.id,
        region: "ru-3",
        ipVersion: "ipv4",
        prefixLength: 29,
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    subnet1 = selectel.VpcSubnetV2("subnet1",
        project_id=selectel_vpc_project_v2["project_1"]["id"],
        region="ru-3",
        ip_version="ipv4",
        prefix_length=29)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := selectel.NewVpcSubnetV2(ctx, "subnet1", &selectel.VpcSubnetV2Args{
    			ProjectId:    pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
    			Region:       pulumi.String("ru-3"),
    			IpVersion:    pulumi.String("ipv4"),
    			PrefixLength: pulumi.Float64(29),
    		})
    		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.VpcSubnetV2("subnet1", new()
        {
            ProjectId = selectel_vpc_project_v2.Project_1.Id,
            Region = "ru-3",
            IpVersion = "ipv4",
            PrefixLength = 29,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.VpcSubnetV2;
    import com.pulumi.selectel.VpcSubnetV2Args;
    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 VpcSubnetV2("subnet1", VpcSubnetV2Args.builder()
                .projectId(selectel_vpc_project_v2.project_1().id())
                .region("ru-3")
                .ipVersion("ipv4")
                .prefixLength(29)
                .build());
    
        }
    }
    
    resources:
      subnet1:
        type: selectel:VpcSubnetV2
        properties:
          projectId: ${selectel_vpc_project_v2.project_1.id}
          region: ru-3
          ipVersion: ipv4
          prefixLength: 29
    

    Create VpcSubnetV2 Resource

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

    Constructor syntax

    new VpcSubnetV2(name: string, args: VpcSubnetV2Args, opts?: CustomResourceOptions);
    @overload
    def VpcSubnetV2(resource_name: str,
                    args: VpcSubnetV2Args,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcSubnetV2(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,
                    vpc_subnet_v2_id: Optional[str] = None)
    func NewVpcSubnetV2(ctx *Context, name string, args VpcSubnetV2Args, opts ...ResourceOption) (*VpcSubnetV2, error)
    public VpcSubnetV2(string name, VpcSubnetV2Args args, CustomResourceOptions? opts = null)
    public VpcSubnetV2(String name, VpcSubnetV2Args args)
    public VpcSubnetV2(String name, VpcSubnetV2Args args, CustomResourceOptions options)
    
    type: selectel:VpcSubnetV2
    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 VpcSubnetV2Args
    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 VpcSubnetV2Args
    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 VpcSubnetV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcSubnetV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcSubnetV2Args
    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 vpcSubnetV2Resource = new Selectel.VpcSubnetV2("vpcSubnetV2Resource", new()
    {
        ProjectId = "string",
        Region = "string",
        IpVersion = "string",
        PrefixLength = 0,
        VpcSubnetV2Id = "string",
    });
    
    example, err := selectel.NewVpcSubnetV2(ctx, "vpcSubnetV2Resource", &selectel.VpcSubnetV2Args{
    	ProjectId:     pulumi.String("string"),
    	Region:        pulumi.String("string"),
    	IpVersion:     pulumi.String("string"),
    	PrefixLength:  pulumi.Float64(0),
    	VpcSubnetV2Id: pulumi.String("string"),
    })
    
    var vpcSubnetV2Resource = new VpcSubnetV2("vpcSubnetV2Resource", VpcSubnetV2Args.builder()
        .projectId("string")
        .region("string")
        .ipVersion("string")
        .prefixLength(0)
        .vpcSubnetV2Id("string")
        .build());
    
    vpc_subnet_v2_resource = selectel.VpcSubnetV2("vpcSubnetV2Resource",
        project_id="string",
        region="string",
        ip_version="string",
        prefix_length=0,
        vpc_subnet_v2_id="string")
    
    const vpcSubnetV2Resource = new selectel.VpcSubnetV2("vpcSubnetV2Resource", {
        projectId: "string",
        region: "string",
        ipVersion: "string",
        prefixLength: 0,
        vpcSubnetV2Id: "string",
    });
    
    type: selectel:VpcSubnetV2
    properties:
        ipVersion: string
        prefixLength: 0
        projectId: string
        region: string
        vpcSubnetV2Id: string
    

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

    ProjectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    IpVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    PrefixLength double
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    VpcSubnetV2Id string
    Unique identifier of the cloud server.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    IpVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    PrefixLength float64
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    VpcSubnetV2Id string
    Unique identifier of the cloud server.
    projectId String
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    ipVersion String
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    prefixLength Double
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    vpcSubnetV2Id String
    Unique identifier of the cloud server.
    projectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    ipVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    prefixLength number
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    vpcSubnetV2Id string
    Unique identifier of the cloud server.
    project_id str
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    ip_version str
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    prefix_length float
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    vpc_subnet_v2_id str
    Unique identifier of the cloud server.
    projectId String
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    ipVersion String
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    prefixLength Number
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    vpcSubnetV2Id String
    Unique identifier of the cloud server.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcSubnetV2 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 associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    Servers List<VpcSubnetV2Server>
    List of the cloud servers that are located in the public subnet.
    Status string
    Status of the cloud server.
    SubnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    Cidr string
    CIDR of the public subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    NetworkId string
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    Servers []VpcSubnetV2Server
    List of the cloud servers that are located in the public subnet.
    Status string
    Status of the cloud server.
    SubnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    cidr String
    CIDR of the public subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    networkId String
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    servers List<VpcSubnetV2Server>
    List of the cloud servers that are located in the public subnet.
    status String
    Status of the cloud server.
    subnetId String
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    cidr string
    CIDR of the public subnet.
    id string
    The provider-assigned unique ID for this managed resource.
    networkId string
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    servers VpcSubnetV2Server[]
    List of the cloud servers that are located in the public subnet.
    status string
    Status of the cloud server.
    subnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    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 associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    servers Sequence[VpcSubnetV2Server]
    List of the cloud servers that are located in the public subnet.
    status str
    Status of the cloud server.
    subnet_id str
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    cidr String
    CIDR of the public subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    networkId String
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    servers List<Property Map>
    List of the cloud servers that are located in the public subnet.
    status String
    Status of the cloud server.
    subnetId String
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.

    Look up Existing VpcSubnetV2 Resource

    Get an existing VpcSubnetV2 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?: VpcSubnetV2State, opts?: CustomResourceOptions): VpcSubnetV2
    @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[VpcSubnetV2ServerArgs]] = None,
            status: Optional[str] = None,
            subnet_id: Optional[str] = None,
            vpc_subnet_v2_id: Optional[str] = None) -> VpcSubnetV2
    func GetVpcSubnetV2(ctx *Context, name string, id IDInput, state *VpcSubnetV2State, opts ...ResourceOption) (*VpcSubnetV2, error)
    public static VpcSubnetV2 Get(string name, Input<string> id, VpcSubnetV2State? state, CustomResourceOptions? opts = null)
    public static VpcSubnetV2 get(String name, Output<String> id, VpcSubnetV2State state, CustomResourceOptions options)
    resources:  _:    type: selectel:VpcSubnetV2    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:
    Cidr string
    CIDR of the public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    NetworkId string
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    PrefixLength double
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    Servers List<VpcSubnetV2Server>
    List of the cloud servers that are located in the public subnet.
    Status string
    Status of the cloud server.
    SubnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    VpcSubnetV2Id string
    Unique identifier of the cloud server.
    Cidr string
    CIDR of the public subnet.
    IpVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    NetworkId string
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    PrefixLength float64
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    ProjectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    Region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    Servers []VpcSubnetV2ServerArgs
    List of the cloud servers that are located in the public subnet.
    Status string
    Status of the cloud server.
    SubnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    VpcSubnetV2Id string
    Unique identifier of the cloud server.
    cidr String
    CIDR of the public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    networkId String
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    prefixLength Double
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    projectId String
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    servers List<VpcSubnetV2Server>
    List of the cloud servers that are located in the public subnet.
    status String
    Status of the cloud server.
    subnetId String
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    vpcSubnetV2Id String
    Unique identifier of the cloud server.
    cidr string
    CIDR of the public subnet.
    ipVersion string
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    networkId string
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    prefixLength number
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    projectId string
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region string
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    servers VpcSubnetV2Server[]
    List of the cloud servers that are located in the public subnet.
    status string
    Status of the cloud server.
    subnetId string
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    vpcSubnetV2Id string
    Unique identifier of the cloud server.
    cidr str
    CIDR of the public subnet.
    ip_version str
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    network_id str
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    prefix_length float
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    project_id str
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region str
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    servers Sequence[VpcSubnetV2ServerArgs]
    List of the cloud servers that are located in the public subnet.
    status str
    Status of the cloud server.
    subnet_id str
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    vpc_subnet_v2_id str
    Unique identifier of the cloud server.
    cidr String
    CIDR of the public subnet.
    ipVersion String
    Internet protocol version supported in the public subnet. The only available value is ipv4.
    networkId String
    Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
    prefixLength Number
    Prefix length of the public subnet. The default value is 29. Changing this creates a new public subnet.
    projectId String
    Unique identifier of the associated project. Changing this creates a new public subnet. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
    region String
    Pool where the public subnet is located, for example, ru-3. Changing this creates a new public subnet. Learn more about available pools in the Availability matrix.
    servers List<Property Map>
    List of the cloud servers that are located in the public subnet.
    status String
    Status of the cloud server.
    subnetId String
    Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
    vpcSubnetV2Id String
    Unique identifier of the cloud server.

    Supporting Types

    VpcSubnetV2Server, VpcSubnetV2ServerArgs

    Id string
    Unique identifier of the cloud server.
    Name string
    Name of the cloud server.
    Status string
    Status of the cloud server.
    Id string
    Unique identifier of the cloud server.
    Name string
    Name of the cloud server.
    Status string
    Status of the cloud server.
    id String
    Unique identifier of the cloud server.
    name String
    Name of the cloud server.
    status String
    Status of the cloud server.
    id string
    Unique identifier of the cloud server.
    name string
    Name of the cloud server.
    status string
    Status of the cloud server.
    id str
    Unique identifier of the cloud server.
    name str
    Name of the cloud server.
    status str
    Status of the cloud server.
    id String
    Unique identifier of the cloud server.
    name String
    Name of the cloud server.
    status String
    Status of the cloud server.

    Import

    You can import a public subnet:

    export OS_DOMAIN_NAME=<account_id>

    export OS_USERNAME=

    export OS_PASSWORD=

    $ pulumi import selectel:index/vpcSubnetV2:VpcSubnetV2 subnet_1 <public_subnet_id>
    

    where:

    • <account_id> — Selectel account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.

    • <username> — Name of the service user. To get the name, in the Control panel, go to Identity & Access ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.

    • <password> — Password of the service user.

    • <public_subnet_id> is a unique identifier of the public subnet, for example, 2060. To get the public subnet ID, use Selectel Cloud Management API.

    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 logo
    selectel 6.4.0 published on Monday, Apr 14, 2025 by selectel