---
title: 'Ресурс selectel_vpc_license_v2'
sidebar_label: "selectel_vpc_license_v2"
description: 'Manages a license for Selectel cloud servers using public API v2'
sidebar_position: 34
---

# Ресурс selectel\_vpc\_license\_v2

:::info

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

:::

Manages a license for cloud servers using public API v2.

## Example Usage \{#example-usage}

```hcl
resource "selectel_vpc_license_v2" "license_windows_2016_standard" {
  project_id = selectel_vpc_project_v2.project_1.id
  region     = "ru-2"
  type       = "license_windows_2012_standard"
}
```

## Argument Reference \{#argument-reference}

* `project_id` - (Required) Unique identifier of the associated project. Changing this creates a new license. Retrieved from the [selectel\_vpc\_project\_v2](/terraform/selectel-provider-reference/resources/vpc_project_v2) resource. Learn more about [Projects](/access-control/projects/about-projects/).

* `region` - (Required) Pool where you can use the license, for example, `ru-3`. The cloud server must be located in the pool. Changing this creates a new license. Learn more about available pools in the [Availability matrix](/infrastructure/availability-matrix/).

* `type` - (Required) Type of the license. Changing this creates a new license. Available values are `license_windows_2012_standard`, `license_windows_2016_standard`, `license_windows_2019_standard`.

## Attributes Reference \{#attributes-reference}

* `status` - License status.

* `servers` - Cloud servers that use the license.

  * `id` - Unique identifier of the cloud server.

  * `name` - Name of the cloud server.

  * `status` - Status of the cloud server.

* `network_id` - Unique identifier of the associated OpenStack network. Learn more about the [openstack\_networking\_network\_v2](/terraform/openstack-provider-reference/networking-neutron/resources/openstack_networking_network_v2/) resource in the official OpenStack documentation.

* `subnet_id` - Unique identifier of the associated OpenStack subnet. Learn more about the [openstack\_networking\_subnet\_v2](/terraform/openstack-provider-reference/networking-neutron/resources/openstack_networking_subnet_v2/) resource in the official OpenStack documentation.

* `port_id` - Unique identifier of the associated OpenStack port. Learn more about the [openstack\_networking\_port\_v2](/terraform/openstack-provider-reference/networking-neutron/resources/openstack_networking_port_v2/) resource in the official OpenStack documentation.

## Import \{#import}

You can import a license:

```shell
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
terraform import selectel_vpc_license_v2.license_1 <license_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/users_management/users?type=service), 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/access-management/).

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

* `<license_id>` — Unique identifier of the license, for example, `4123`. To get the license ID, use [Selectel Cloud Management API](https://developers.selectel.ru/docs/selectel-cloud-platform/main-services/selectel_cloud_management_api/).
