---
title: 'Ресурс selectel_dedicated_private_subnet_v1'
sidebar_label: "selectel_dedicated_private_subnet_v1"
description: 'Creates and manages a private subnet for Selectel Dedicated Servers using public API v1'
sidebar_position: 17
---

# Ресурс selectel\_dedicated\_private\_subnet\_v1

:::info

Эта инструкция — копия документации Selectel Terraform-провайдера в [Terraform Registry](https://registry.terraform.io/providers/selectel/selectel/latest/docs).

:::

Creates and manages a private subnet for dedicated servers using public API v1.
Learn how to [assign a private IP address to a dedicated server](/dedicated/networks/private-networks-and-subnets/#assign-private-ip-address-to-server).

## Example usage \{#example-usage}

```hcl
resource "selectel_dedicated_private_subnet_v1" "private_subnet_1" {
  location_id = data.selectel_dedicated_location_v1.server_location.locations[0].id
  vlan        = "1000"
  subnet      = "192.168.100.0/24"
}
```

## Argument Reference \{#argument-reference}

* `location_id` — (Required) Unique identifier of the location where the private subnet will be created.
  Retrieved from the [selectel\_dedicated\_location\_v1](/terraform/selectel-provider-reference/data-sources/dedicated_location_v1/) data source.

* `vlan` — (Required) Unique identifier of the VLAN for the private subnet.
  To get the unique identifier of the VLAN, in the [Control panel](https://my.selectel.ru/servers), go to **Products** ⟶ **Dedicated Servers** ⟶ **Servers** ⟶ servers page ⟶ in the **Private** block, select a private subnet → copy the ID in the **VLAN** field.

* `subnet` — (Required) CIDR block for the private subnet.
  Must be within private IP ranges: `10.0.0.0/8`, `172.16.0.0/12`, or `192.168.0.0/16`.
  Lern more about [Private networks and subnets of the dedicated server](/dedicated/networks/private-networks-and-subnets/).

## Attributes Reference \{#attributes-reference}

* `id` — Unique identifier of the private subnet.

* `vlan` — Unique identifier of the VLAN of the private subnet.

* `subnet` — CIDR block of the private subnet.
  Learn more about [Private networks and subnets of the dedicated server](/dedicated/networks/private-networks-and-subnets/).

## Import \{#import}

You can import a private subnet:

```shell
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export INFRA_PROJECT_ID=<selectel_project_id>
terraform import selectel_dedicated_private_subnet_v1.subnet_1 <subnet_id>
```

where:

* `<account_id>` — Selectel account ID.
  The account ID is in the top right corner of the [Control panel](https://my.selectel.ru/).
  Learn more about [Registration](/account/registration/).

* `<username>` — Name of the service user.
  To get the name, in the [Control panel](https://my.selectel.ru/iam/service-users), go to **Identity & Access Management** ⟶ **User management** ⟶ the **Service users** tab ⟶ copy the name of the required user.
  Learn more about [Service users](/access-control/user-types/#service-users).

* `<password>` — Password of the service user.

* `<selectel_project_id>` — Unique identifier of the associated project.
  To get the ID, in the [Control panel](https://my.selectel.ru/servers), go to **Products** ⟶ **Dedicated Servers** ⟶ project name ⟶ **Project management** ⟶ copy the ID of the required project.
  Learn more about [Projects](/access-control/projects/about-projects/).

* `<subnet_id>` — Unique identifier of the private subnet.
