selectel.VpcSubnetV2
Explore with Pulumi AI
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:
- Project
Id 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. - Ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - Prefix
Length double - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - Vpc
Subnet stringV2Id - Unique identifier of the cloud server.
- Project
Id 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. - Ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - Prefix
Length float64 - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - Vpc
Subnet stringV2Id - Unique identifier of the cloud server.
- project
Id 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. - ip
Version String - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - prefix
Length Double - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - vpc
Subnet StringV2Id - Unique identifier of the cloud server.
- project
Id 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. - ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - prefix
Length number - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - vpc
Subnet stringV2Id - 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_ strv2_ id - Unique identifier of the cloud server.
- project
Id 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. - ip
Version String - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - prefix
Length Number - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - vpc
Subnet StringV2Id - 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.
- Network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- Servers
List<Vpc
Subnet V2Server> - List of the cloud servers that are located in the public subnet.
- Status string
- Status of the cloud server.
- Subnet
Id 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.
- Network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- Servers
[]Vpc
Subnet V2Server - List of the cloud servers that are located in the public subnet.
- Status string
- Status of the cloud server.
- Subnet
Id 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.
- network
Id String - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- servers
List<Vpc
Subnet V2Server> - List of the cloud servers that are located in the public subnet.
- status String
- Status of the cloud server.
- subnet
Id 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.
- network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- servers
Vpc
Subnet V2Server[] - List of the cloud servers that are located in the public subnet.
- status string
- Status of the cloud server.
- subnet
Id 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[Vpc
Subnet V2Server] - 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.
- network
Id 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.
- subnet
Id 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.
- Cidr string
- CIDR of the public subnet.
- Ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - Network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- Prefix
Length double - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - Project
Id 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<Vpc
Subnet V2Server> - List of the cloud servers that are located in the public subnet.
- Status string
- Status of the cloud server.
- Subnet
Id string - Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
- Vpc
Subnet stringV2Id - Unique identifier of the cloud server.
- Cidr string
- CIDR of the public subnet.
- Ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - Network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- Prefix
Length float64 - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - Project
Id 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
[]Vpc
Subnet V2Server Args - List of the cloud servers that are located in the public subnet.
- Status string
- Status of the cloud server.
- Subnet
Id string - Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
- Vpc
Subnet stringV2Id - Unique identifier of the cloud server.
- cidr String
- CIDR of the public subnet.
- ip
Version String - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - network
Id String - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- prefix
Length Double - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - project
Id 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<Vpc
Subnet V2Server> - List of the cloud servers that are located in the public subnet.
- status String
- Status of the cloud server.
- subnet
Id String - Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
- vpc
Subnet StringV2Id - Unique identifier of the cloud server.
- cidr string
- CIDR of the public subnet.
- ip
Version string - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - network
Id string - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- prefix
Length number - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - project
Id 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
Vpc
Subnet V2Server[] - List of the cloud servers that are located in the public subnet.
- status string
- Status of the cloud server.
- subnet
Id string - Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
- vpc
Subnet stringV2Id - 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[Vpc
Subnet V2Server Args] - 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_ strv2_ id - Unique identifier of the cloud server.
- cidr String
- CIDR of the public subnet.
- ip
Version String - Internet protocol version supported in the public subnet. The only available value is
ipv4
. - network
Id String - Unique identifier of the associated OpenStack network. Learn more about the openstack_networking_network_v2 resource in the official OpenStack documentation.
- prefix
Length Number - Prefix length of the public subnet. The default value is
29
. Changing this creates a new public subnet. - project
Id 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.
- subnet
Id String - Unique identifier of the associated OpenStack subnet. Learn more about the openstack_networking_subnet_v2 resource in the official OpenStack documentation.
- vpc
Subnet StringV2Id - Unique identifier of the cloud server.
Supporting Types
VpcSubnetV2Server, VpcSubnetV2ServerArgs
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 Management ⟶ User 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.