---
title: "openstack_compute_flavor_v2"
description: ""
sidebar_position: 1
---

# openstack\_compute\_flavor\_v2

:::info

Эта инструкция — адаптированная копия официальной документации OpenStack Terraform-провайдера в [Terraform Registry](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs). Посмотрите ограничения для изменения ресурса [openstack\_compute\_flavor\_v2](/terraform/manage-resources/#openstack-compute-flavor-v2-limitations).

:::

Manages a V2 flavor resource within OpenStack.

## Example Usage \{#example-usage}

```hcl
resource "openstack_compute_flavor_v2" "test-flavor" {
  name  = "my-flavor"
  ram   = "8096"
  vcpus = "2"
  disk  = "20"
}
```

## Argument Reference \{#argument-reference}

The following arguments are supported:

* `region` - (Optional) The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the `region` argument of the provider is used. Changing this creates a new flavor.

* `name` - (Required) A unique name for the flavor. Changing this creates a new flavor.

* `description` - (Optional) The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

* `ram` - (Required) The amount of RAM to use, in megabytes. Changing this creates a new flavor.

* `flavor_id` - (Optional) Unique ID (string or UUID) of flavor to create. Changing this creates a new flavor.

* `vcpus` - (Required) The number of virtual CPUs to use. Changing this creates a new flavor.

* `disk` - (Required) The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

* `ephemeral` - (Optional) The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor. Applicable only to [Private Clouds](https://selectel.ru/services/cloud/private-cloud/).

* `swap` - (Optional) The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.  Applicable only to [Private Clouds](https://selectel.ru/services/cloud/private-cloud/).

* `rx_tx_factor` - (Optional) RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

* `is_public` - (Optional) Whether the flavor is public. Changing this creates a new flavor. Applicable only to [Private Clouds](https://selectel.ru/services/cloud/private-cloud/).

* `extra_specs` - (Optional) Key/Value pairs of metadata for the flavor. Applicable only to [Private Clouds](https://selectel.ru/services/cloud/private-cloud/).

## Attributes Reference \{#attributes-reference}

The following attributes are exported:

* `region` - See Argument Reference above.
* `name` - See Argument Reference above.
* `description` - See Argument Reference above.
* `ram` - See Argument Reference above.
* `vcpus` - See Argument Reference above.
* `disk` - See Argument Reference above.
* `ephemeral` - See Argument Reference above.
* `swap` - See Argument Reference above.
* `rx_tx_factor` - See Argument Reference above.
* `is_public` - See Argument Reference above.
* `extra_specs` - See Argument Reference above.

## Import \{#import}

Flavors can be imported using the `ID`, e.g.

```bash
$ terraform import openstack_compute_flavor_v2.my-flavor 4142e64b-1b35-44a0-9b1e-5affc7af1106
```
