# 

# exoscale_anti_affinity_group (Resource)

Manage Exoscale [Anti-Affinity Groups](https://community.exoscale.com/product/compute/instances/how-to/anti-affinity/).

Corresponding data source: [exoscale_anti_affinity_group]({{< ref "../data-sources/anti_affinity_group.md" >}}).

## Example Usage

```terraform
resource "exoscale_anti_affinity_group" "my_anti_affinity_group" {
  name        = "my-anti-affinity-group"
  description = "Prevent compute instances to run on the same host"
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) ❗ The anti-affinity group name.

### Optional

- `description` (String) ❗ A free-form text describing the group.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)
- `read` (String)

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

## Import

```shell
# An existing anti-affinity group may be imported by `<ID>`:

terraform import \
  exoscale_anti_affinity_group.my_anti_affinity_group \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
```

