# Exoscale Documentation — Terraform Provider

> Effortlessly manage Exoscale cloud infrastructure resources with the Exoscale Terraform Provider, automating provisioning, updates, and configuration at scale.

---

url: https://community.exoscale.com/reference/terraform/

---

# Terraform Provider

- [Exoscale Provider](https://community.exoscale.com/reference/terraform/provider/index.md) - The Exoscale provider can be used to manage infrastructure resources running on Exoscale.

---

url: https://community.exoscale.com/reference/terraform/provider/

---

# Exoscale Provider

## Configuration

The following provider-level settings are supported, either via [HCL
parameters][tf-doc-provider] or environment variables:

* `key` / `EXOSCALE_API_KEY`: Exoscale account API key
* `secret` / `EXOSCALE_API_SECRET`: Exoscale account API secret
* `timeout`: Global async operations waiting time in seconds (default: `300`)

At least an [Exoscale API key and secret][exo-iam] must be provided in order to
use the Exoscale Terraform provider.


### Example

```terraform
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
    }
  }
}

provider "exoscale" {
  key = "EXOxxxxxxxxxxxxxxxxxxxxxxxx"
  secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
```


## Schema

### Optional

- `environment` (String)
- `key` (String) Exoscale API key
- `secret` (String, Sensitive) Exoscale API secret
- `sos_endpoint` (String)
- `timeout` (Number) Timeout in seconds for waiting on compute resources to become available (by default: 3600)

### Fine-tuning Timeout durations

In addition of the global `timeout` provider setting, the waiting time of async
operations can be fine-tuned per resource and per operation type:

```terraform
resource "exoscale_instance_pool" "web" {
  # ...

  timeouts {
    create = "1m"
    read   = "2m"
    update = "3m"
    delete = "4m"
  }
}
```


## Usage

Here is a simple HCL configuration provisioning an Exoscale Compute instance:

```terraform
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
    }
  }
}

variable "exoscale_api_key" { type = string }
variable "exoscale_api_secret" { type = string }
provider "exoscale" {
  key    = var.exoscale_api_key
  secret = var.exoscale_api_secret
}

locals {
  my_zone     = "ch-gva-2"
  my_template = "Linux Ubuntu 22.04 LTS 64-bit"
}

data "exoscale_template" "my_template" {
  zone = local.my_zone
  name = local.my_template
}

resource "exoscale_compute_instance" "my_instance" {
  zone        = local.my_zone
  name        = "my-instance"

  template_id = data.exoscale_template.my_template.id
  type        = "standard.medium"
  disk_size   = 10

  user_data   = "#cloud-config\npackage_upgrade: true\n"
}
```

```console
terraform init

Output:

Initializing the backend...

Initializing provider plugins...
- Finding latest version of exoscale/exoscale...
- Installing exoscale/exoscale v0.38.0...
- Installed exoscale/exoscale v0.38.0 (signed by a HashiCorp partner, key ID 81426F034A3D05F7)

...

terraform apply \
  -var exoscale_api_key=$EXOSCALE_API_KEY \
  -var exoscale_api_secret=$EXOSCALE_API_SECRET

Output:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # exoscale_compute_instance.my-server will be created
  + resource "exoscale_compute_instance" "my-server" {
      + created_at        = (known after apply)
      + disk_size         = 50
      + id                = (known after apply)
      + ipv6              = false
      + ipv6_address      = (known after apply)
      + name              = "my-instance"
      + public_ip_address = (known after apply)
      + ssh_key           = "my-ssh-key"
      + state             = (known after apply)
      + template_id       = "3ebca0c5-63f4-4055-b325-3cef0e68fa98"
      + type              = "standard.medium"
      + user_data         = <<-EOT
            #cloud-config
            package_upgrade: true
        EOT
      + zone              = "ch-gva-2"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value:
...
```

Additional documentation can be found in the [examples][tf-exo-gh-examples]
directory of the source code.

## Simple Object Storage (SOS)

-> The Exoscale provider does not manage [SOS][exo-sos] resources. As SOS is
S3-compatible, [Terraform AWS provider][tf-provider-aws] can be used instead to
[manage your SOS resources][exo-sos-terraform].

[exo-iam]: https://community.exoscale.com/documentation/iam/quick-start/
[tf-doc-provider]: https://www.terraform.io/docs/configuration/providers.html
[tf-exo-gh-examples]: https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples
[tf-provider-aws]: https://registry.terraform.io/providers/hashicorp/aws/latest/docs
[exo-sos]: https://community.exoscale.com/documentation/storage
[exo-sos-terraform]: https://community.exoscale.com/product/storage/

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/

---

# Data Sources



---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/anti_affinity_group/

---

# exoscale_anti_affinity_group (Data Source)

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

Corresponding resource: [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md).

## Example Usage

```terraform
data "exoscale_anti_affinity_group" "my_anti_affinity_group" {
  name = "my-anti-affinity-group"
}

output "my_anti_affinity_group_id" {
  value = data.exoscale_anti_affinity_group.my_anti_affinity_group.id
}
```

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


## Schema

### Optional

- `id` (String) The anti-affinity group ID to match (conflicts with `name`).
- `name` (String) The group name to match (conflicts with `id`).

### Read-Only

- `instances` (Set of String) The list of attached [exoscale_compute_instance](https://community.exoscale.com/reference/terraform/provider/resources/compute_instance/index.md) (IDs).

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/block_storage_volume/

---

# exoscale_block_storage_volume (Data Source)

Fetch [Exoscale Block Storage](https://community.exoscale.com/product/storage/block-storage/index.md) Volume.

Block Storage offers persistent externally attached volumes for your workloads.

Corresponding resource: [exoscale_block_storage_volume](https://community.exoscale.com/reference/terraform/provider/resources/block_storage_volume/index.md).




## Schema

### Required

- `id` (String) Volume ID to match.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `blocksize` (Number) Volume block size.
- `created_at` (String) Volume creation date.
- `instance` (Attributes) Volume attached instance. (see [below for nested schema](#nestedatt--instance))
- `labels` (Map of String) Resource labels.
- `name` (String) Volume name.
- `size` (Number) Volume size in GB.
- `snapshots` (Attributes Set) Volume snapshots. (see [below for nested schema](#nestedatt--snapshots))
- `state` (String) Volume state.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--instance"></a>
### Nested Schema for `instance`

Read-Only:

- `id` (String) Instance ID.


<a id="nestedatt--snapshots"></a>
### Nested Schema for `snapshots`

Read-Only:

- `id` (String) Snapshot ID.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/block_storage_volume_snapshot/

---

# exoscale_block_storage_volume_snapshot (Data Source)

Fetch [Exoscale Block Storage](https://community.exoscale.com/product/storage/block-storage/index.md) Snapshot.

Block Storage offers persistent externally attached volumes for your workloads.

Corresponding resource: [exoscale_block_storage_snapshot](https://community.exoscale.com/reference/terraform/provider/resources/block_storage_volume_snapshot/index.md).




## Schema

### Required

- `id` (String) Snapshot ID to match.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `created_at` (String) Snapshot creation date.
- `labels` (Map of String) Labels.
- `name` (String) Snapshot name.
- `size` (Number) Snapshot size in GB.
- `state` (String) Snapshot state.
- `volume` (Attributes) Block Storage Volume. (see [below for nested schema](#nestedatt--volume))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--volume"></a>
### Nested Schema for `volume`

Read-Only:

- `id` (String) Volume ID.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/compute_instance/

---

# exoscale_compute_instance (Data Source)

Fetch Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/) data.

Corresponding resource: [exoscale_compute_instance](https://community.exoscale.com/reference/terraform/provider/resources/compute_instance/index.md).

## Example Usage

```terraform
data "exoscale_compute_instance" "my_instance" {
  zone = "ch-gva-2"
  name = "my-instance"
}

output "my_instance_id" {
  value = data.exoscale_compute_instance.my_instance.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The compute instance ID to match (conflicts with `name`).
- `name` (String) The instance name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `anti_affinity_group_ids` (Set of String) The list of attached [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs).
- `created_at` (String) The compute instance creation date.
- `deploy_target_id` (String) A deploy target ID.
- `disk_size` (Number) The instance disk size (GiB).
- `elastic_ip_ids` (Set of String) The list of attached [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md) (IDs).
- `enable_secure_boot` (Boolean) Indicates if the instance has secure boot enabled.
- `enable_tpm` (Boolean) Indicates if the instance has TPM enabled.
- `ipv6` (Boolean) Whether IPv6 is enabled on the instance.
- `ipv6_address` (String) The instance (main network interface) IPv6 address (if enabled).
- `labels` (Map of String) A map of key/value labels.
- `manager_id` (String) The instance manager ID, if any.
- `manager_type` (String) The instance manager type (instance pool, SKS node pool, etc.), if any.
- `private_network_ids` (Set of String) The list of attached [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs).
- `public_ip_address` (String) The instance (main network interface) IPv4 address.
- `reverse_dns` (String) Domain name for reverse DNS record.
- `security_group_ids` (Set of String) The list of attached [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs).
- `ssh_key` (String, Deprecated) The [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) authorized on the instance.
- `ssh_keys` (Set of String) The list of [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) authorized on the instance.
- `state` (String) The instance state.
- `template_id` (String) The instance [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md) ID.
- `type` (String) The instance type.
- `user_data` (String) The instance [cloud-init](http://cloudinit.readthedocs.io/en/latest/) configuration.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/compute_instance_list/

---

# exoscale_compute_instance_list (Data Source)

List Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/).

Corresponding resource: [exoscale_compute_instance](https://community.exoscale.com/reference/terraform/provider/resources/compute_instance/index.md).

## Example Usage

```terraform
data "exoscale_compute_instance_list" "my_compute_instance_list" {
  zone = "ch-gva-2"

  type = "standard.micro"

  name = "/.*ubuntu.*/"

  labels = {
    "customer" = "/.*bank.*/"
    "contract" = "premium-support"
  }
}

output "my_compute_instance_ids" {
  value = join("\n", formatlist(
    "%s", data.exoscale_compute_instance_list.my_compute_instance_list.instances.*.id
  ))
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `created_at` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `deploy_target_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `disk_size` (Number) Match against this int
- `enable_secure_boot` (Boolean) Match against this bool
- `enable_tpm` (Boolean) Match against this bool
- `id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `ipv6` (Boolean) Match against this bool
- `ipv6_address` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `labels` (Map of String) Match against key/values. Keys are matched exactly, while values may be matched as a regex if you supply a string that begins and ends with "/"
- `manager_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `manager_type` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `name` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `public_ip_address` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `reverse_dns` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `ssh_key` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `state` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `template_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `type` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `user_data` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.

### Read-Only

- `instances` (Attributes List) The list of [exoscale_compute_instance](https://community.exoscale.com/reference/terraform/provider/data-sources/compute_instance/index.md). (see [below for nested schema](#nestedatt--instances))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--instances"></a>
### Nested Schema for `instances`

Read-Only:

- `anti_affinity_group_ids` (Set of String) The list of attached [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs).
- `created_at` (String) The compute instance creation date.
- `deploy_target_id` (String) A deploy target ID.
- `disk_size` (Number) The instance disk size (GiB).
- `elastic_ip_ids` (Set of String) The list of attached [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md) (IDs).
- `enable_secure_boot` (Boolean) Indicates if the instance has secure boot enabled.
- `enable_tpm` (Boolean) Indicates if the instance has TPM enabled.
- `id` (String) The compute instance ID.
- `ipv6` (Boolean) Whether IPv6 is enabled on the instance.
- `ipv6_address` (String) The instance (main network interface) IPv6 address (if enabled).
- `labels` (Map of String) A map of key/value labels.
- `manager_id` (String) The instance manager ID, if any.
- `manager_type` (String) The instance manager type (instance pool, SKS node pool, etc.), if any.
- `name` (String) The instance name.
- `private_network_ids` (Set of String) The list of attached [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs).
- `public_ip_address` (String) The instance (main network interface) IPv4 address.
- `reverse_dns` (String) Domain name for reverse DNS record.
- `security_group_ids` (Set of String) The list of attached [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs).
- `ssh_key` (String, Deprecated) The [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) authorized on the instance.
- `ssh_keys` (Set of String) The list of [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) authorized on the instance.
- `state` (String) The instance state.
- `template_id` (String) The instance [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md) ID.
- `type` (String) The instance type.
- `user_data` (String) The instance [cloud-init](http://cloudinit.readthedocs.io/en/latest/) configuration.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/database_uri/

---

# exoscale_database_uri (Data Source)

Fetch Exoscale [Database](https://community.exoscale.com/documentation/dbaas/) URI data.

Corresponding resource: [exoscale_database](https://community.exoscale.com/reference/terraform/provider/resources/database/index.md).

!> **WARNING:** This datasource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.

## Example Usage

```terraform
resource "exoscale_database" "my_database" {
  zone = "ch-gva-2"
  name = "my-database"

  type = "pg"
  plan = "startup-4"

  maintenance_dow  = "sunday"
  maintenance_time = "23:00:00"

  termination_protection = true

  pg = {
    version = "13"

    backup_schedule = "04:00"

    ip_filter = [
      "1.2.3.4/32",
      "5.6.7.8/32",
    ]

    pg_settings = jsonencode({
      timezone : "Europe/Zurich"
    })
  }
}

data "exoscale_database_uri" "my_database" {
  name = "my-database"
  type = "pg"
  zone = "ch-gva-2"
}

output "my_database_uri" {
  value = data.exoscale_database_uri.my_database.uri
}
```


## Schema

### Required

- `name` (String) Name of database service to match.
- `type` (String) The type of the database service (`clickhouse`, `kafka`, `mysql`, `opensearch`, `pg`, `valkey`, `grafana`).
- `zone` (String) The Exoscale Zone name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `db_name` (String) Default database name
- `host` (String) Database service hostname
- `id` (String) The ID of this resource.
- `password` (String, Sensitive) Admin user password
- `port` (Number) Database service port
- `schema` (String) Database service connection schema
- `uri` (String, Sensitive) Database service connection URI.
- `username` (String) Admin user username

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/domain/

---

# exoscale_domain (Data Source)

Fetch Exoscale [DNS](https://community.exoscale.com/product/networking/dns/index.md) Domains data.

Corresponding resource: [exoscale_domain](https://community.exoscale.com/reference/terraform/provider/resources/domain/index.md).

## Example Usage

```terraform
data "exoscale_domain" "my_domain" {
  name = "my.domain"
}

output "my_domain_id" {
  value = data.exoscale_domain.my_domain.id
}
```

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


## Schema

### Required

- `name` (String) The DNS domain name to match.

### Optional

- `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:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/domain_record/

---

# exoscale_domain_record (Data Source)

Fetch Exoscale [DNS](https://community.exoscale.com/product/networking/dns/index.md) Domain Records data.

Corresponding resource: [exoscale_domain_record](https://community.exoscale.com/reference/terraform/provider/resources/domain_record/index.md).

## Example Usage

```terraform
data "exoscale_domain" "my_domain" {
  name = "my.domain"
}

data "exoscale_domain_record" "my_exoscale_domain_A_records" {
  domain = data.exoscale_domain.my_domain.name
  filter {
    name        = "my-host"
    record_type = "A"
  }
}

data "exoscale_domain_record" "my_exoscale_domain_NS_records" {
  domain = data.exoscale_domain.my_domain.name
  filter {
    content_regex = "ns.*"
  }
}

output "my_exoscale_domain_A_records" {
  value = join("\n", formatlist(
    "%s", data.exoscale_domain_record.my_exoscale_domain_A_records.records.*.name
  ))
}

output "my_exoscale_domain_NS_records" {
  value = join("\n", formatlist(
    "%s", data.exoscale_domain_record.my_exoscale_domain_NS_records.records.*.content
  ))
}
```

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


## Schema

### Required

- `domain` (String) The [exoscale_domain](https://community.exoscale.com/reference/terraform/provider/data-sources/domain/index.md) name to match.

### Optional

- `filter` (Block, Optional) Filter to apply when looking up domain records. (see [below for nested schema](#nestedblock--filter))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `records` (Attributes List) The list of matching records. Structure is documented below. (see [below for nested schema](#nestedatt--records))

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

Optional:

- `content_regex` (String) A regular expression to match the record content (conflicts with `id`, `name` and `record_type`).
- `id` (String) The record ID to match (conflicts with `name`, `record_type` and `content_regex`).
- `name` (String) The domain record name to match (conflicts with `id` and `content_regex`; can be combined with `record_type`).
- `record_type` (String) The record type to match (conflicts with `id` and `content_regex`; can be combined with `name`).


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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--records"></a>
### Nested Schema for `records`

Read-Only:

- `content` (String) Content of the Record
- `domain` (String) Domain of the Record
- `id` (String) ID of the Record
- `name` (String) Name of the Record
- `prio` (Number) Priority of the Record
- `record_type` (String) Type of the Record
- `ttl` (Number) TTL of the Record

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/elastic_ip/

---

# exoscale_elastic_ip (Data Source)

Fetch Exoscale [Elastic IPs (EIP)](https://community.exoscale.com/product/networking/eip/index.md) data.

Corresponding resource: [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md).

## Example Usage

```terraform
data "exoscale_elastic_ip" "my_elastic_ip" {
  zone       = "ch-gva-2"
  ip_address = "1.2.3.4"
}

output "my_elastic_ip_id" {
  value = data.exoscale_elastic_ip.my_elastic_ip.id
}
```

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


## Schema

### Required

- `zone` (String) The Exocale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The Elastic IP (EIP) ID to match (conflicts with `ip_address` and `labels`).
- `ip_address` (String) The EIP IPv4 or IPv6 address to match (conflicts with `id` and `labels`).
- `labels` (Map of String) The EIP labels to match (conflicts with `ip_address` and `id`).

### Read-Only

- `address_family` (String) The Elastic IP (EIP) address family (`inet4` or `inet6`).
- `cidr` (String) The Elastic IP (EIP) CIDR.
- `description` (String) The Elastic IP (EIP) description.
- `healthcheck` (List of Object) The *managed* EIP healthcheck configuration. (see [below for nested schema](#nestedatt--healthcheck))
- `reverse_dns` (String) Domain name for reverse DNS record.

<a id="nestedatt--healthcheck"></a>
### Nested Schema for `healthcheck`

Read-Only:

- `interval` (Number)
- `mode` (String)
- `port` (Number)
- `strikes_fail` (Number)
- `strikes_ok` (Number)
- `timeout` (Number)
- `tls_skip_verify` (Boolean)
- `tls_sni` (String)
- `uri` (String)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/iam_api_key/

---

# exoscale_iam_api_key (Data Source)

Fetch Exoscale [IAM](https://community.exoscale.com/documentation/iam/) API Key.

Corresponding resource: [exoscale_iam_role](https://community.exoscale.com/reference/terraform/provider/resources/iam_api_key/index.md).




## Schema

### Required

- `key` (String) The IAM API Key to match.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String) IAM API Key name.
- `role_id` (String) IAM API Key role ID.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/iam_org_policy/

---

# exoscale_iam_org_policy (Data Source)

Fetch Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Organization Policy.

Corresponding resource: [exoscale_iam_org_policy](https://community.exoscale.com/reference/terraform/provider/resources/iam_org_policy/index.md).




## Schema

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `default_service_strategy` (String) Default service strategy (`allow` or `deny`).
- `id` (String) The ID of this resource.
- `services` (Attributes Map) IAM policy services. (see [below for nested schema](#nestedatt--services))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--services"></a>
### Nested Schema for `services`

Read-Only:

- `rules` (Attributes List) List of IAM service rules (if type is `rules`). (see [below for nested schema](#nestedatt--services--rules))
- `type` (String) Service type (`rules`, `allow`, or `deny`).

<a id="nestedatt--services--rules"></a>
### Nested Schema for `services.rules`

Read-Only:

- `action` (String) IAM policy rule action (`allow` or `deny`).
- `expression` (String) IAM policy rule expression.
- `resources` (List of String, Deprecated)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/iam_role/

---

# exoscale_iam_role (Data Source)

Fetch Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Role.

Corresponding resource: [exoscale_iam_role](https://community.exoscale.com/reference/terraform/provider/resources/iam_role/index.md).




## Schema

### Optional

- `id` (String) The role ID to match (conflicts with `name`).
- `name` (String) the role name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `description` (String) A free-form text describing the IAM Role
- `editable` (Boolean) Defines if IAM Role Policy is editable or not.
- `labels` (Map of String) IAM Role labels.
- `permissions` (List of String) IAM Role permissions.
- `policy` (Attributes) IAM Policy. (see [below for nested schema](#nestedatt--policy))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--policy"></a>
### Nested Schema for `policy`

Read-Only:

- `default_service_strategy` (String) Default service strategy (`allow` or `deny`).
- `services` (Attributes Map) IAM policy services. (see [below for nested schema](#nestedatt--policy--services))

<a id="nestedatt--policy--services"></a>
### Nested Schema for `policy.services`

Read-Only:

- `rules` (Attributes List) List of IAM service rules (if type is `rules`). (see [below for nested schema](#nestedatt--policy--services--rules))
- `type` (String) Service type (`rules`, `allow`, or `deny`).

<a id="nestedatt--policy--services--rules"></a>
### Nested Schema for `policy.services.rules`

Read-Only:

- `action` (String) IAM policy rule action (`allow` or `deny`).
- `expression` (String) IAM policy rule expression.
- `resources` (List of String, Deprecated)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool/

---

# exoscale_instance_pool (Data Source)

Fetch Exoscale [Instance Pools](https://community.exoscale.com/product/compute/instances/how-to/instance-pools/index.md) data.

Corresponding resource: [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md).

## Example Usage

```terraform
data "exoscale_instance_pool" "my_instance_pool" {
  zone = "ch-gva-2"
  name = "my-instance-pool"
}

output "my_instance_pool_id" {
  value = data.exoscale_instance_pool.my_instance_pool.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The instance pool ID to match (conflicts with `name`).
- `labels` (Map of String) A map of key/value labels.
- `name` (String) The pool name to match (conflicts with `id`).

### Read-Only

- `affinity_group_ids` (Set of String, Deprecated) The list of attached [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs). Use anti_affinity_group_ids instead.
- `anti_affinity_group_ids` (Set of String) The list of attached [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs).
- `deploy_target_id` (String) The deploy target ID.
- `description` (String) The instance pool description.
- `disk_size` (Number) The managed instances disk size.
- `elastic_ip_ids` (Set of String) The list of attached [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md) (IDs).
- `instance_prefix` (String) The string used to prefix the managed instances name.
- `instance_type` (String) The managed instances type.
- `instances` (Set of Object) The list of managed instances. Structure is documented below. (see [below for nested schema](#nestedatt--instances))
- `ipv6` (Boolean) Whether IPv6 is enabled on managed instances.
- `key_pair` (String) The [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) authorized on the managed instances.
- `min_available` (Number) Minimum number of running Instances.
- `network_ids` (Set of String) The list of attached [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs).
- `security_group_ids` (Set of String) The list of attached [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs).
- `size` (Number) The number managed instances.
- `state` (String) The pool state.
- `template_id` (String) The managed instances [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md) ID.
- `user_data` (String) [cloud-init](http://cloudinit.readthedocs.io/en/latest/) configuration.

<a id="nestedatt--instances"></a>
### Nested Schema for `instances`

Read-Only:

- `id` (String)
- `ipv6_address` (String)
- `name` (String)
- `public_ip_address` (String)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool_list/

---

# exoscale_instance_pool_list (Data Source)

List Exoscale [Instance Pools](https://community.exoscale.com/product/compute/instances/how-to/instance-pools/index.md).

Corresponding resource: [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md).

## Example Usage

```terraform
data "exoscale_instance_pool_list" "my_instance_pool_list" {
  zone = "ch-gva-2"
}

output "my_instance_pool_ids" {
  value = join("\n", formatlist(
    "%s", data.exoscale_instance_pool_list.my_instance_pool_list.pools.*.id
  ))
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Read-Only

- `id` (String) The ID of this resource.
- `pools` (List of Object) The list of [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool/index.md). (see [below for nested schema](#nestedatt--pools))

<a id="nestedatt--pools"></a>
### Nested Schema for `pools`

Read-Only:

- `affinity_group_ids` (Set of String)
- `anti_affinity_group_ids` (Set of String)
- `deploy_target_id` (String)
- `description` (String)
- `disk_size` (Number)
- `elastic_ip_ids` (Set of String)
- `id` (String)
- `instance_prefix` (String)
- `instance_type` (String)
- `instances` (Set of Object) (see [below for nested schema](#nestedobjatt--pools--instances))
- `ipv6` (Boolean)
- `key_pair` (String)
- `labels` (Map of String)
- `min_available` (Number)
- `name` (String)
- `network_ids` (Set of String)
- `security_group_ids` (Set of String)
- `size` (Number)
- `state` (String)
- `template_id` (String)
- `user_data` (String)
- `zone` (String)

<a id="nestedobjatt--pools--instances"></a>
### Nested Schema for `pools.instances`

Read-Only:

- `id` (String)
- `ipv6_address` (String)
- `name` (String)
- `public_ip_address` (String)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/nlb/

---

# exoscale_nlb (Data Source)

Fetch Exoscale [Network Load Balancers (NLB)](https://community.exoscale.com/product/networking/nlb/index.md) data.

Corresponding resource: [exoscale_nlb](https://community.exoscale.com/reference/terraform/provider/resources/nlb/index.md).

## Example Usage

```terraform
data "exoscale_nlb" "my_nlb" {
  zone = "ch-gva-2"
  name = "my-nlb"
}

output "my_nlb_id" {
  value = data.exoscale_nlb.my_nlb.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The Network Load Balancers (NLB) ID to match (conflicts with `name`).
- `name` (String) The NLB name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `address_family` (String) The NLB address family (`inet4` or `inet6`).
- `created_at` (String) The NLB creation date.
- `description` (String) The Network Load Balancers (NLB) description.
- `ip_address` (String) The NLB public IP address (IPv4 or IPv6, depending on `address_family`).
- `labels` (Map of String) A map of key/value labels.
- `state` (String) The current NLB state.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/nlb_service_list/

---

# exoscale_nlb_service_list (Data Source)

Fetch Exoscale [Network Load Balancers (NLB)](https://community.exoscale.com/product/networking/nlb/index.md) Services.

Corresponding resource: [exoscale_nlb](https://community.exoscale.com/reference/terraform/provider/resources/nlb/index.md).

## Example Usage

```terraform
data "exoscale_nlb_service_list" "example_nlb_services" {
  name = "my-nlb"
}

# Outputs
output "nlb_services_output" {
  value = data.exoscale_nlb_service_list.example_nlb_services.services
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `nlb_id` (String) The NLB ID to match (conflicts with `nlb_name`).
- `nlb_name` (String) The NLB name to match (conflicts with `nlb_id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `services` (Attributes List) The list of [exoscale_nlb_service](https://community.exoscale.com/reference/terraform/provider/data-sources/nlb_service_list/index.md). (see [below for nested schema](#nestedatt--services))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--services"></a>
### Nested Schema for `services`

Read-Only:

- `description` (String) NLB service description.
- `healthcheck` (Object) (see [below for nested schema](#nestedatt--services--healthcheck))
- `id` (String) NLB service ID.
- `instance_pool_id` (String) The [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool/index.md) (ID) to forward traffic to.
- `name` (String) NLB Service name.
- `port` (Number) Port exposed on the NLB's public IP.
- `protocol` (String) Network traffic protocol.
- `state` (String) NLB Service State.
- `strategy` (String) The strategy (`round-robin`|`source-hash`).
- `target_port` (Number) Port on which the network traffic will be forwarded to on the receiving instance.

<a id="nestedatt--services--healthcheck"></a>
### Nested Schema for `services.healthcheck`

Read-Only:

- `interval` (Number)
- `mode` (String)
- `port` (Number)
- `retries` (Number)
- `timeout` (Number)
- `tls_sni` (String)
- `uri` (String)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/private_network/

---

# exoscale_private_network (Data Source)

Fetch Exoscale [Private Networks](https://community.exoscale.com/product/networking/private-network/index.md) data.

Corresponding resource: [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md).

## Example Usage

```terraform
data "exoscale_private_network" "my_private_network" {
  zone = "ch-gva-2"
  name = "my-private-network"
}

output "my_private_network_id" {
  value = data.exoscale_private_network.my_private_network.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The private network ID to match (conflicts with `name`).
- `name` (String) The network name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `description` (String) The private network description.
- `end_ip` (String) The first/last IPv4 addresses used by the DHCP service for dynamic leases.
- `labels` (Map of String) A map of key/value labels.
- `netmask` (String) The network mask defining the IPv4 network allowed for static leases.
- `start_ip` (String) The first/last IPv4 addresses used by the DHCP service for dynamic leases.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/security_group/

---

# exoscale_security_group (Data Source)

Fetch [Exoscale Security Groups](https://community.exoscale.com/product/compute/instances/quick-start/index.md#firewall-rules---security-groups).

Security Groups are firewall rules. Each Security Group may be attached to one or many compute instances.

Corresponding resource: [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md).

## Example Usage

```terraform
data "exoscale_security_group" "my_security_group" {
  name = "my-security-group"
}

output "my_security_group_id" {
  value = data.exoscale_security_group.my_security_group.id
}
```

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


## Schema

### Optional

- `id` (String) The ID of the Security Group (required if `name` is not set).
- `name` (String) The name of the Security Group (required if `id` is not set).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `description` (String) A free-form text describing the the Security Group.
- `external_sources` (Set of String) A list of external network sources, in [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation) notation.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster/

---

# exoscale_sks_cluster (Data Source)

Fetch Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Cluster data.

Corresponding resource: [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/index.md).




## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The SKS cluster ID to match (conflicts with `name`).
- `name` (String) The SKS cluster name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `addons` (Set of String) The list of enabled add-ons.
- `auto_upgrade` (Boolean) Enable automatic upgrading of the control plane version.
- `cni` (String) The CNI plugin that is to be used.
- `created_at` (String) The cluster creation date.
- `default_security_group_id` (String) The ID of the cluster's ad-hoc default security group.
- `description` (String) A free-form text describing the cluster.
- `enable_kube_proxy` (Boolean) Indicates whether the Kubernetes network proxy is deployed.
- `endpoint` (String) The cluster API endpoint.
- `feature_gates` (Set of String) Feature gates options for the cluster.
- `karpenter_feature_gates` (Set of String) A list of Karpenter controller feature gates to enable for the Karpenter controller binary.
- `labels` (Map of String) A map of key/value labels.
- `nodepools` (Set of String) The list of [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_nodepool/index.md) (IDs) attached to the cluster.
- `service_level` (String) The service level of the control plane.
- `state` (String) The cluster state.
- `version` (String) The version of the control plane.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster_list/

---

# exoscale_sks_cluster_list (Data Source)

List Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Clusters in a zone.

Corresponding resource: [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/index.md).




## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `clusters` (Attributes List) The list of [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster/index.md) in the zone. (see [below for nested schema](#nestedatt--clusters))
- `id` (String) The ID of this resource.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--clusters"></a>
### Nested Schema for `clusters`

Read-Only:

- `addons` (Set of String) The list of enabled add-ons.
- `auto_upgrade` (Boolean) Enable automatic upgrading of the control plane version.
- `cni` (String) The CNI plugin that is to be used.
- `created_at` (String) The cluster creation date.
- `default_security_group_id` (String) The ID of the cluster's ad-hoc default security group.
- `description` (String) A free-form text describing the cluster.
- `enable_kube_proxy` (Boolean) Indicates whether the Kubernetes network proxy is deployed.
- `endpoint` (String) The cluster API endpoint.
- `feature_gates` (Set of String) Feature gates options for the cluster.
- `id` (String) The SKS cluster ID.
- `karpenter_feature_gates` (Set of String) A list of Karpenter controller feature gates to enable for the Karpenter controller binary.
- `labels` (Map of String) A map of key/value labels.
- `name` (String) The SKS cluster name.
- `nodepools` (Set of String) The list of [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_nodepool/index.md) (IDs) attached to the cluster.
- `service_level` (String) The service level of the control plane.
- `state` (String) The cluster state.
- `version` (String) The version of the control plane.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/sks_nodepool/

---

# exoscale_sks_nodepool (Data Source)

Fetch Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Node Pool data.

Corresponding resource: [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/resources/sks_nodepool/index.md).




## Schema

### Required

- `cluster_id` (String) The parent [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/index.md) ID.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The SKS node pool ID to match (conflicts with `name`).
- `name` (String) The SKS node pool name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `anti_affinity_group_ids` (Set of String) A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs) attached to the managed instances.
- `created_at` (String) The pool creation date.
- `deploy_target_id` (String) A deploy target ID.
- `description` (String) A free-form text describing the pool.
- `disk_size` (Number) The managed instances disk size (GiB).
- `instance_pool_id` (String) The underlying [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md) ID.
- `instance_prefix` (String) The string used to prefix the managed instances name.
- `instance_type` (String) The managed compute instances type (`<family>.<size>`, e.g. `standard.medium`).
- `ipv6` (Boolean) Whether IPv6 is enabled for the nodepool nodes.
- `kubelet_image_gc` (Attributes) Configuration for this nodepool's kubelet image garbage collector. (see [below for nested schema](#nestedatt--kubelet_image_gc))
- `kubelet_max_pods` (Number) The maximum number of pods per node.
- `labels` (Map of String) A map of key/value labels.
- `nvidia_mig_profile` (String) The NVIDIA [Multi-Instance GPU (MIG)](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/) profile enabled on the managed GPUs.
- `private_network_ids` (Set of String) A list of [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs) attached to the managed instances.
- `security_group_ids` (Set of String) A list of [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs) attached to the managed instances.
- `size` (Number) The number of managed instances.
- `state` (String) The current pool state.
- `storage_lvm` (Boolean) Whether nodes were created with non-standard partitioning for persistent storage.
- `taints` (Map of String) A map of key/value Kubernetes [taints](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) ('<value>:<effect>").
- `template_id` (String) The managed instances template ID.
- `version` (String) The managed instances version.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--kubelet_image_gc"></a>
### Nested Schema for `kubelet_image_gc`

Read-Only:

- `high_threshold` (Number) The percent of disk usage after which image garbage collection is always run
- `low_threshold` (Number) The percent of disk usage before which image garbage collection is never run
- `min_age` (String) The minimum age for an unused image before it is garbage collected (k8s duration format, eg. 1h)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/sks_nodepool_list/

---

# exoscale_sks_nodepool_list (Data Source)

List Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Node Pools in a zone.

Corresponding resource: [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/resources/sks_nodepool/index.md).




## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `nodepools` (Attributes List) The list of [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_nodepool/index.md) in the zone. (see [below for nested schema](#nestedatt--nodepools))

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.


<a id="nestedatt--nodepools"></a>
### Nested Schema for `nodepools`

Read-Only:

- `anti_affinity_group_ids` (Set of String) A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs) attached to the managed instances.
- `cluster_id` (String) The parent [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster/index.md) ID.
- `created_at` (String) The pool creation date.
- `deploy_target_id` (String) A deploy target ID.
- `description` (String) A free-form text describing the pool.
- `disk_size` (Number) The managed instances disk size (GiB).
- `id` (String) The SKS node pool ID.
- `instance_pool_id` (String) The underlying [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md) ID.
- `instance_prefix` (String) The string used to prefix the managed instances name.
- `instance_type` (String) The managed compute instances type (`<family>.<size>`, e.g. `standard.medium`).
- `ipv6` (Boolean) Whether IPv6 is enabled for the nodepool nodes.
- `kubelet_image_gc` (Attributes) Configuration for this nodepool's kubelet image garbage collector. (see [below for nested schema](#nestedatt--nodepools--kubelet_image_gc))
- `kubelet_max_pods` (Number) The maximum number of pods per node.
- `labels` (Map of String) A map of key/value labels.
- `name` (String) The SKS node pool name.
- `nvidia_mig_profile` (String) The NVIDIA [Multi-Instance GPU (MIG)](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/) profile enabled on the managed GPUs.
- `private_network_ids` (Set of String) A list of [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs) attached to the managed instances.
- `security_group_ids` (Set of String) A list of [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs) attached to the managed instances.
- `size` (Number) The number of managed instances.
- `state` (String) The current pool state.
- `storage_lvm` (Boolean) Whether nodes were created with non-standard partitioning for persistent storage.
- `taints` (Map of String) A map of key/value Kubernetes [taints](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) ('<value>:<effect>").
- `template_id` (String) The managed instances template ID.
- `version` (String) The managed instances version.

<a id="nestedatt--nodepools--kubelet_image_gc"></a>
### Nested Schema for `nodepools.kubelet_image_gc`

Read-Only:

- `high_threshold` (Number) The percent of disk usage after which image garbage collection is always run
- `low_threshold` (Number) The percent of disk usage before which image garbage collection is never run
- `min_age` (String) The minimum age for an unused image before it is garbage collected (k8s duration format, eg. 1h)

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/sos_bucket_policy/

---

# exoscale_sos_bucket_policy (Data Source)

Fetch Exoscale [SOS Bucket Policies](https://community.exoscale.com/product/storage/object-storage/how-to/bucketpolicy/index.md).




## Schema

### Required

- `bucket` (String) The name of the bucket to which the policy is to be applied.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `policy` (String) The content of the policy

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/template/

---

# exoscale_template (Data Source)

Fetch Exoscale [Compute Instance Templates](https://community.exoscale.com/product/compute/instances/how-to/custom-templates/index.md) data.

Exoscale instance templates are regularly updated to include the latest updates. Whenever this happens, the template ID also changes which can lead terraform to plan the recreation of an instance. To work around this you may find [this issue](https://github.com/exoscale/terraform-provider-exoscale/issues/366) helpful.

## Example Usage

```terraform
data "exoscale_template" "my_template" {
  zone = "ch-gva-2"
  name = "Linux Ubuntu 22.04 LTS 64-bit"
}

output "my_template_id" {
  value = data.exoscale_template.my_template.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The compute instance template ID to match (conflicts with `name`).
- `name` (String) The template name to match (conflicts with `id`) (when multiple templates have the same name, the newest one will be returned).
- `visibility` (String) A template category filter (default: `public`); among: - `public` - official Exoscale templates - `private` - custom templates private to my organization

### Read-Only

- `default_user` (String) Username to use to log into a compute instance based on this template

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/vpc/

---

# exoscale_vpc (Data Source)

Fetch Exoscale [VPC](https://community.exoscale.com/product/networking/vpc/index.md) data.

Corresponding resource: [exoscale_vpc](https://community.exoscale.com/reference/terraform/provider/resources/vpc/index.md).

## Example Usage

```terraform
data "exoscale_vpc" "my_vpc" {
  zone = "ch-gva-2"
  name = "my-vpc"
}

output "my_vpc_id" {
  value = data.exoscale_vpc.my_vpc.id
}
```

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


## Schema

### Required

- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The VPC ID to match (conflicts with `name`).
- `name` (String) The VPC name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `default` (Boolean) Whether this is the organization's default VPC for the zone.
- `description` (String) The VPC description.
- `dns_servers` (List of String) DHCP option 6: a list of DNS server IPv4 addresses.
- `domain_search` (List of String) DHCP option 119: a list of domain search strings.
- `labels` (Map of String) A map of key/value labels.
- `ntp_servers` (List of String) DHCP option 42: a list of NTP server IPv4 addresses.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/vpc_subnet/

---

# exoscale_vpc_subnet (Data Source)

Fetch Exoscale [VPC](https://community.exoscale.ch/product/networking/vpc/) Subnet data.

Corresponding resource: [exoscale_vpc_subnet](https://community.exoscale.com/reference/terraform/provider/resources/vpc_subnet/index.md).

## Example Usage

```terraform
data "exoscale_vpc_subnet" "my_vpc_subnet" {
  zone   = "ch-gva-2"
  vpc_id = "9ecc6b8b-73d4-4211-8ced-f7f29bb79524"
  name   = "my-vpc-subnet"
}

output "my_vpc_subnet_id" {
  value = data.exoscale_vpc_subnet.my_vpc_subnet.id
}
```

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


## Schema

### Required

- `vpc_id` (String) The parent [exoscale_vpc](https://community.exoscale.com/reference/terraform/provider/data-sources/vpc/index.md) ID.
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `id` (String) The Subnet ID to match (conflicts with `name`).
- `name` (String) The Subnet name to match (conflicts with `id`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `address_family` (String) The Subnet address family.
- `address_space` (String) The Subnet address space.
- `description` (String) The Subnet description.
- `ipv4_block` (String) The Subnet IPv4 CIDR.
- `labels` (Map of String) A map of key/value labels.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

---

url: https://community.exoscale.com/reference/terraform/provider/data-sources/zones/

---

# exoscale_zones (Data Source)

Lists all zones.

## Example Usage

```terraform
data "exoscale_zones" "example_zones" {}

# Outputs
output "zones_output" {
  value = data.exoscale_zones.example_zones.zones
}
```

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


## Schema

### Read-Only

- `zones` (List of String) List of zones

---

url: https://community.exoscale.com/reference/terraform/provider/guides/

---

# Guides



---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-dbaas-from-v0_67_x-to-v0_68_x/

---

# Migrating DBAAS from v0.67.x to v0.68.x

This guide covers the migration of `exoscale_dbaas` resources from provider version ~> 0.67.x to ~> 0.68.x.

## Overview

Version 0.68.0 introduces a syntax change for database type-specific configuration blocks in the `exoscale_dbaas` resource. The configuration blocks now use attribute assignment syntax (`=`) instead of nested block syntax.

This is purely a configuration syntax change. No Terraform state modifications nor resource recreations are required.

~> **Note:** Before migrating resources you need to ensure you use the latest version of Terraform and have a clean configuration.

## What has Changed

### Database Type Configuration Syntax

All database type-specific configuration blocks (`pg`, `mysql`, `kafka`, `opensearch`, `valkey`, `grafana`) now use attribute assignment syntax with an object.

**Before (v0.67.x):**
```hcl
pg {
  version = "16"
  backup_schedule = "05:00"
}
```

**After (v0.68.x):**
```hcl
pg = {
  version = "16"
  backup_schedule = "05:00"
}
```

## Migration Steps

### 1. Update Provider Version

Update your Terraform configuration to use version 0.68.0 or later:

```hcl
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
      version = "~> 0.68.0"
    }
  }
}
```

### 2. Update Configuration Syntax

Update your `exoscale_dbaas` resources by adding an equals sign (`=`) after the database type block name.

#### Example: PostgreSQL

**Before:**
```hcl
resource "exoscale_dbaas" "postgres" {
  zone = "ch-gva-2"
  name = "my-postgres-db"
  type = "pg"

  plan = "hobbyist-2"

  maintenance_dow  = "sunday"
  maintenance_time = "02:00:00"

  termination_protection = false

  pg {
    version = "16"
    backup_schedule = "05:00"
  }
}
```

**After:**
```hcl
resource "exoscale_dbaas" "postgres" {
  zone = "ch-gva-2"
  name = "my-postgres-db"
  type = "pg"

  plan = "hobbyist-2"

  maintenance_dow  = "sunday"
  maintenance_time = "02:00:00"

  termination_protection = false

  pg = {
    version = "16"
    backup_schedule = "05:00"
  }
}
```

#### Example: MySQL

**Before:**
```hcl
mysql {
  version = "8"
  backup_schedule = "03:00"
}
```

**After:**
```hcl
mysql = {
  version = "8"
  backup_schedule = "03:00"
}
```

#### Example: Kafka

**Before:**
```hcl
kafka {
  version = "3.6"
  kafka_rest_enabled = true
}
```

**After:**
```hcl
kafka = {
  version = "3.6"
  kafka_rest_enabled = true
}
```

### 3. Verify Changes

After updating your configuration:

1. Run `terraform init -upgrade` to upgrade the provider
2. Run `terraform plan` to verify the changes

You should see output similar to:

```
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
```

## Additional Resources
- [exoscale_dbaas Resource](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/dbaas)

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-domain-from-v0_70_x-to-v0_71_x/

---

# Migrating Domain from v0.70.x to v0.71.x

This guide covers the migration of `exoscale_domain` and `exoscale_domain_record` resources (and their data sources) from provider version ~> 0.70.x to ~> 0.71.x.

## Overview

Version 0.71.0 migrates `exoscale_domain` and `exoscale_domain_record` (resources and data sources) from the legacy SDKv2 implementation to the Terraform plugin framework.

No configuration syntax changes are required, and no resources are recreated. The only breaking change is the removal of four attributes from `exoscale_domain` that were already deprecated and always empty.

~> **Note:** Before migrating resources you need to ensure you use the latest version of Terraform and have a clean configuration.

## What has Changed

### Removed attributes on `exoscale_domain`

`token`, `state`, `auto_renew` and `expires_on` have been removed from the `exoscale_domain` resource. These attributes were marked deprecated ("Not used, will be removed in the future") and were never populated by the provider, so no real data is lost. If your configuration references any of them (for example in an `output`, or interpolated into another resource), remove those references.

## Migration Steps

### 1. Update Provider Version

```hcl
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
      version = "~> 0.71.0"
    }
  }
}
```

### 2. Remove references to the dropped attributes

Search your configuration for `.token`, `.state`, `.auto_renew` or `.expires_on` used against an `exoscale_domain` resource or data source, and remove them.

### 3. Verify Changes

After updating your configuration:

1. Run `terraform init -upgrade` to upgrade the provider.
2. Run `terraform apply -refresh-only` once.
3. Run `terraform plan` to verify there are no further changes.

You should see output similar to:

```
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
```

## Additional Resources
- [exoscale_domain Resource](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/domain)
- [exoscale_domain_record Resource](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/domain_record)

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-compute/

---

# Migrating from compute with nic to a compute_instance

-> This migration guide applies to Exoscale Terraform Provider **version 0.34.0 to 0.53.2**.

This page helps you migrate from an `exoscale_compute`, `exoscale_network` and `exoscale_nic` resources (which are deprecated) to the `exoscale_compute_instance` and `exoscale_private_network` resources.

~> **Note:** Before migrating resources you need to ensure you use the latest version of Terraform and have a clean configuration.

Before proceeding, please:
- Upgrade the Exoscale provider to at least v0.34.0: allow us to run [`terraform import`](https://www.terraform.io/docs/commands/import.html) on `exoscale_compute_instance` resource;
- Ensure your configuration can be successfully applied: [`terraform plan`](https://www.terraform.io/docs/commands/plan.html) must NOT output errors, changes, or moves of resources;
- Have the [Exoscale cli](https://github.com/exoscale/cli/) to retrieve IDs of compute instance and private network;
- Perform a backup of your state! We are going to manipulate it, and errors can always happen. Remote states can be retrieved with [`terraform state pull` and restored with `terraform state push`](https://www.terraform.io/cli/state/recover). If you keep your state as a single local file, a regular file copy can do the job.

## Example configuration

In this guide, we will assume the following configuration as an example:

```terraform
resource "exoscale_compute" "my_instance" {
  disk_size = 10
  display_name = "my-instance"
  security_group_ids = ["493ac3c0-c8ba-415a-a038-6578194a6d36"]
  size = "Tiny"
  template_id = "ee73810b-0245-43e0-8b15-0632473d56ba"
  zone = "ch-gva-2"
}

resource "exoscale_network" "my_network" {
  name = "privnet"
  display_text = "Private Network"
  zone = "ch-gva-2"
}

resource "exoscale_nic" "my_nic" {
  compute_id = exoscale_compute.my_instance.id
  network_id = exoscale_network.my_network.id
}
```

As you can see, we have a single `exoscale_compute` (instance) attached to the `exoscale_network` (private network) using `exoscale_nic` resource.

The Terraform state contains them as well:

```bash
$ terraform state list
exoscale_compute.my_instance
exoscale_network.my_network
exoscale_nic.my_nic
```

We want to migrate `exoscale_compute` and `exoscale_nic` to the `exoscale_compute_instance` resource and `exoscale_network` to the `exoscale_private_network` resource.


## Migration plan

To achieve this migration, we have to remove all 3 deprecated resources from the state and then import them as `exoscale_compute_instance` and `exoscale_private_network`.

## Applying the migration plan

### Removing the resources from the state

This step is pretty straightforward: we will have to issue a `terraform state rm` command for each resource we have to remove from the state. In our example, we have to remove `exoscale_compute.my_instance`, `exoscale_network.my_network` and `exoscale_nic.my_nic`:

```bash
$ terraform state rm exoscale_compute.my_instance
Removed exoscale_compute.my_instance
Successfully removed 1 resource instance(s).

$ terraform state rm exoscale_network.my_network
Removed exoscale_network.my_network
Successfully removed 1 resource instance(s).

$ terraform state rm exoscale_nic.my_nic
Removed exoscale_nic.my_nic
Successfully removed 1 resource instance(s).
```

Now, these resources are removed from the state.

### Update infrastructure definition

Replace the `exoscale_network` block by the new `exoscale_private_network` resource:

```terraform
resource "exoscale_private_network" "my_network" {
  name = "privnet"
  description = "Private Network"
  zone = "ch-gva-2"
}
```

In this example we are using unmanaged private network, for managed network you can copy values from `exoscale_network` definition with the following changes:
- `display_text` must be renamed to `description`;
- `tags` must be renamed to `labels`;
- `network_offering` is deprecated and should be removed.

Now replace `exoscale_compute` and `exoscale_nic` blocks with `exoscale_compute_instance`:

```terraform
resource "exoscale_compute_instance" "my_instance" {
  disk_size = 10
  name = "my-instance"
  security_group_ids = ["493ac3c0-c8ba-415a-a038-6578194a6d36"]
  template_id = "ee73810b-0245-43e0-8b15-0632473d56ba"
  type = "standard.tiny"
  zone = "ch-gva-2"

  network_interface {
    network_id = exoscale_private_network.my_network.id
  }
}
```

Again for other attributes that are not in the example you can copy them with the following rules:
- `affinity_group_ids` must be renamed to `anti_affinity_group_ids`;
- `affinity_groups` is unsupported and must be replaced with `affinity_group_ids` (we recommend using `exoscale_anti_affinity_group` datasource for anti-affinity group name->id mapping);
- `display_name` must be renamed as `name`;
- `hostname` is deprecated (`name` is used instead) and should be removed;
- `ip4` is deprecated and should be removed;
- `key_pair` must be renamed to `ssh_key`;
- `keyboard` is deprecated and should be removed;
- `security_groups` is unsupported and must be replaced with `security_group_ids` (we recommend using `exoscale_security_group` datasource for security group name->id mapping);
- `size` must be replaced with `type` and format changed to `<family>.<size>` (check [docs](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/compute_instance#type) for details)
- `tags` must be renamed to `labels`;
- `template` is unsupported and must be replaced with `template_id` (we recommend using `exoscale_template` datasource for template name->id mapping);

### Importing the `compute_instance` and `private_network` into the state

Using the [Exoscale cli](https://github.com/exoscale/cli/), we can find the ID of the `privnet` private network:

```bash
$ exo compute private-network show privnet
┼─────────────────┼──────────────────────────────────────┼
│ PRIVATE NETWORK │                                      │
┼─────────────────┼──────────────────────────────────────┼
│ ID              │ cbdb7256-30d2-8dc4-288c-d7f58bc9e308 │
│ Name            │ privnet                              │
│ Description     │ Private Network                      │
│ Zone            │ ch-gva-2                             │
│ Type            │ manual                               │
┼─────────────────┼──────────────────────────────────────┼
```

In our case, it's `cbdb7256-30d2-8dc4-288c-d7f58bc9e308`. Let's import this resource:

```bash
$ terraform import exoscale_private_network.my_network cbdb7256-30d2-8dc4-288c-d7f58bc9e308@ch-gva-2
exoscale_private_network.my_network: Importing from ID "cbdb7256-30d2-8dc4-288c-d7f58bc9e308@ch-gva-2"...
exoscale_private_network.my_network: Import prepared!
  Prepared exoscale_private_network for import
exoscale_private_network.my_network: Refreshing state... [id=cbdb7256-30d2-8dc4-288c-d7f58bc9e308]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
```

As you can see, and as expected, the import process imported `exoscale_private_network.my_network`.
We also import  `exoscale_compute_instance` the same way. To find instance ID, we must use CLI again:

```bash
$ exo c i show my-instance
┼──────────────────────┼──────────────────────────────────────┼
│   COMPUTE INSTANCE   │                                      │
┼──────────────────────┼──────────────────────────────────────┼
│ ID                   │ 0e28952c-1ae9-45fc-9f6d-0a9710175fd8 │
│ Name                 │ my-instance                          │
│ Creation Date        │ 2023-07-21 16:29:28 +0000 UTC        │
│ Instance Type        │ standard.tiny                        │
│ Template             │ Linux Ubuntu 22.04 LTS 64-bit        │
│ Zone                 │ ch-gva-2                             │
│ Anti-Affinity Groups │ n/a                                  │
│ Deploy Target        │ -                                    │
│ Security Groups      │ default                              │
│ Private Instance     │ No                                   │
│ Private Networks     │ privnet                              │
│ Elastic IPs          │ n/a                                  │
│ IP Address           │ 194.182.161.116                      │
│ IPv6 Address         │ -                                    │
│ SSH Key              │ -                                    │
│ Disk Size            │ 10 GiB                               │
│ State                │ running                              │
│ Labels               │ n/a                                  │
│ Reverse DNS          │                                      │
┼──────────────────────┼──────────────────────────────────────┼
```

Instance ID is `0e28952c-1ae9-45fc-9f6d-0a9710175fd8` and we can import it:

```bash
$ terraform import exoscale_compute_instance.my_instance 0e28952c-1ae9-45fc-9f6d-0a9710175fd8@ch-gva-2

```

In order to check this result and display details on newly imported rules, we have to run [`terraform plan`](https://www.terraform.io/docs/commands/plan.html):

```bash
$ terraform apply
exoscale_private_network.my_network: Refreshing state... [id=cbdb7256-30d2-8dc4-288c-d7f58bc9e308]
exoscale_compute_instance.my_instance: Refreshing state... [id=0e28952c-1ae9-45fc-9f6d-0a9710175fd8]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
```

Here we can see that our configuration is matching the state: no resources will be changed.
Our Terraform state matches the related configuration, so migration is completely done.

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-security-group-rules/

---

# Migrating from security_group_rules to security_group

-> This migration guide applies to Exoscale Terraform Provider **version 0.31.3 to 0.53.2**.

This page helps you migrate from an `exoscale_security_group_rules` resource (which is deprecated) to a set of `exoscale_security_group_rule`.

~> **Note:** Before migrating `exoscale_security_group_rules` resources you need to ensure you use the latest version of Terraform and have a clean configuration.

Before proceeding, please:
- Upgrade the Exoscale provider to at least v0.31.3: allow us to run [`terraform import`](https://www.terraform.io/docs/commands/import.html) on `exoscale_security_group` and `exoscale_security_group_rule` resources.
- Ensure your configuration can be successfully applied: [`terraform plan`](https://www.terraform.io/docs/commands/plan.html) must NOT output errors, changes, or moves of resources
- Have the [Exoscale cli](https://github.com/exoscale/cli/) to retrieve IDs of security groups and security group rules
- Perform a backup of your state! We are going to manipulate it, and errors can always happen. Remote states can be retrieved with [`terraform state pull` and restored with `terraform state push`](https://www.terraform.io/cli/state/recover). If you keep your state as a single local file, a regular file copy can do the job.

## Example configuration

In this guide, we will assume the following configuration as an example:

```terraform
resource "exoscale_security_group" "webapp" {
  name = "webapp"
  # ...
}

resource "exoscale_security_group" "bastion" {
  name = "bastion"
  # ...
}

resource "exoscale_security_group_rules" "webapp" {
  security_group_id = exoscale_security_group.webapp.id

  ingress {
    ports = ["22"]
    protocol = "TCP"
    user_security_group_list = [exoscale_security_group.bastion.name]
  }

  ingress {
    ports = ["80"]
    protocol = "TCP"
    cidr_list = ["0.0.0.0/0"]
  }

  ingress {
    ports = ["443"]
    protocol = "TCP"
    cidr_list = ["0.0.0.0/0"]
  }
}
```

As you can see, we have a security group with an associated `security_group_rules` resource that:
- allows access from every IPv4 address to ports 80 and 443, and
- allows access to port 22 from hosts that belongs to another security group named `bastion`.

From the [Exoscale cli](https://github.com/exoscale/cli/), we can retrieve information for every security group:

```bash
exo compute sg list
# [output]
# ┼──────────────────────────────────────┼─────────┼
# │                  ID                  │  NAME   │
# ┼──────────────────────────────────────┼─────────┼
# │ b83fe506-51e6-4933-8e70-205df6b640fa │ webapp  │
# │ e1654b58-64f6-4efc-b8d9-7bbda86a83fa │ bastion │
# │ a0191fd7-1275-4614-9fed-be6f19a770a0 │ default │
# ┼──────────────────────────────────────┼─────────┼
```

The Terraform state contains them as well:

```bash
terraform state list
# [output]
# exoscale_security_group.bastion
# exoscale_security_group.webapp
# exoscale_security_group_rules.webapp
```

We want to migrate the single `exoscale_security_group_rules.webapp` to 3 different `exoscale_security_group_rule` resources, as we have 3 different ingress rules.

~> **Note:** If in your `exoscale_security_group_rules` definition `ingress` and/or `egress` blocks define multiple ports or port ranges (as `ports` attribute is an array), you need to define one `exoscale_security_group_rule` for each port or port range as multiple values per rule are no longer allowed.


## Migration plan

To achieve this migration, we have to remove from the state:
- `exoscale_security_group.webapp`
- **ALL rules** that belongs to `exoscale_security_group.webapp`. In our case: `exoscale_security_group_rules.webapp`

After these resources are removed from the state, we will have to import `exoscale_security_group.webapp` back as well as related security group rules as `exoscale_security_group_rule` resources.

## Applying the migration plan

### Removing the security group from the state

This step is pretty straightforward: we will have to issue a `terraform state rm` command for each resources we have to
remove from the state. In our example, we have to remove `exoscale_security_group.webapp`, and `exoscale_security_group_rules.webapp`:

```bash
terraform state rm exoscale_security_group_rules.webapp
# [output]
# Removed exoscale_security_group_rules.webapp
# Successfully removed 1 resource instance(s).

terraform state rm exoscale_security_group.webapp
# [output]
# Removed exoscale_security_group.webapp
# Successfully removed 1 resource instance(s).
```

Now, these resources are removed from the state.

### Update infrastructure definition

Replace the `exoscale_security_group_rules` block by new `exoscale_security_group_rule` resources:

```terraform
resource "exoscale_security_group_rule" "webapp_ssh" {
  security_group_id = exoscale_security_group.webapp.id
  type = "INGRESS"
  start_port = 22
  end_port   = 22
  protocol = "TCP"
  user_security_group_id = exoscale_security_group.bastion.id
}

resource "exoscale_security_group_rule" "webapp_public" {
  for_each = toset(["80", "443"])

  security_group_id = exoscale_security_group.webapp.id
  type = "INGRESS"
  start_port = each.value
  end_port   = each.value
  protocol = "TCP"
  cidr = "0.0.0.0/0"
}
```

Note that we can of course imagine 3 single resource blocks: `webapp_http` and `webapp_https` replacing `webapp_public` in addition to `webapp_ssh`.
In our example we tried instead to follow the semantic behind each rule, and group them:
- `webapp_ssh` allows access to SSH through a bastion security group
- `webapp_public` allows access to HTTP(S) services, on both port 80 and 443, leveraging the [`for_each` notation of Terraform](https://www.terraform.io/language/meta-arguments/for_each).

### Importing the security group and related rules into the state

Using the [Exoscale cli](https://github.com/exoscale/cli/), we can find the ID of the webapp security group:

```bash
exo compute sg list
# [output]
# ┼──────────────────────────────────────┼─────────┼
# │                  ID                  │  NAME   │
# ┼──────────────────────────────────────┼─────────┼
# │ b83fe506-51e6-4933-8e70-205df6b640fa │ webapp  │
# │ e1654b58-64f6-4efc-b8d9-7bbda86a83fa │ bastion │
# │ a0191fd7-1275-4614-9fed-be6f19a770a0 │ default │
# ┼──────────────────────────────────────┼─────────┼
```

In our case, it's `b83fe506-51e6-4933-8e70-205df6b640fa`. Let's import this resource:

```bash
terraform import exoscale_security_group.webapp b83fe506-51e6-4933-8e70-205df6b640fa
# [output]
# exoscale_security_group.webapp: Importing from ID "b83fe506-51e6-4933-8e70-205df6b640fa"...
# exoscale_security_group.webapp: Import prepared!
#   Prepared exoscale_security_group for import
# exoscale_security_group.webapp: Refreshing state... [id=b83fe506-51e6-4933-8e70-205df6b640fa]
#
# Import successful!
#
# The resources that were imported are shown above. These resources are now in
# your Terraform state and will henceforth be managed by Terraform.
```

As you can see, and as expected, the import process imported `exoscale_security_group.webapp`.
We also need to import related `exoscale_security_group_rule` resources. To find their IDs, we must use CLI again:

```bash
exo c security-group show b83fe506-51e6-4933-8e70-205df6b640fa
┼──────────────────┼─────────────────────────────────────────────────────────────────────┼
│  SECURITY GROUP  │                                                                     │
┼──────────────────┼─────────────────────────────────────────────────────────────────────┼
│ ID               │ b83fe506-51e6-4933-8e70-205df6b640fa                                │
│ Name             │ webapp                                                              │
│ Description      │                                                                     │
│ Ingress Rules    │                                                                     │
│                  │   5dafa58d-ba4d-4990-b66d-2996782ee3f3      TCP   0.0.0.0/0   22    │
│                  │   e7bbda2b-3c93-4693-a54c-465ac28bda59      TCP   0.0.0.0/0   443   │
│                  │   0a187bd0-b5dc-4a58-bab2-44bc7064b83b      TCP   0.0.0.0/0   80    │
│                  │                                                                     │
│ Egress Rules     │ -                                                                   │
│ External Sources │ -                                                                   │
┼──────────────────┼─────────────────────────────────────────────────────────────────────┼
```

Security group rule IDs can by found in `Ingress Rules`: `5dafa58d-ba4d-4990-b66d-2996782ee3f3`, `e7bbda2b-3c93-4693-a54c-465ac28bda59` and `0a187bd0-b5dc-4a58-bab2-44bc7064b83b`.
Now we can import them one by one:

```bash
terraform import exoscale_security_group_rule.webapp_ssh b83fe506-51e6-4933-8e70-205df6b640fa/5dafa58d-ba4d-4990-b66d-2996782ee3f3
# [output]
# exoscale_security_group_rule.webapp_ssh: Importing from ID "b83fe506-51e6-4933-8e70-205df6b640fa/5dafa58d-ba4d-4990-b66d-2996782ee3f3"...
# exoscale_security_group_rule.webapp_ssh: Import prepared!
#   Prepared exoscale_security_group_rule for import
# exoscale_security_group_rule.webapp_ssh: Refreshing state... [id=5dafa58d-ba4d-4990-b66d-2996782ee3f3]
#
# Import successful!
#
# The resources that were imported are shown above. These resources are now in
# your Terraform state and will henceforth be managed by Terraform.

terraform import 'exoscale_security_group_rule.webapp_public["443"]' b83fe506-51e6-4933-8e70-205df6b640fa/e7bbda2b-3c93-4693-a54c-465ac28bda59
# [output]
# exoscale_security_group_rule.webapp_public["443"]: Importing from ID "b83fe506-51e6-4933-8e70-205df6b640fa/e7bbda2b-3c93-4693-a54c-465ac28bda59"...
# exoscale_security_group_rule.webapp_public["443"]: Import prepared!
#   Prepared exoscale_security_group_rule for import
# exoscale_security_group_rule.webapp_public["443"]: Refreshing state... [id=e7bbda2b-3c93-4693-a54c-465ac28bda59]
#
# Import successful!
#
# The resources that were imported are shown above. These resources are now in
# your Terraform state and will henceforth be managed by Terraform.

terraform import 'exoscale_security_group_rule.webapp_public["80"]' b83fe506-51e6-4933-8e70-205df6b640fa/0a187bd0-b5dc-4a58-bab2-44bc7064b83b
# [output]
# exoscale_security_group_rule.webapp_public["80"]: Importing from ID "b83fe506-51e6-4933-8e70-205df6b640fa/0a187bd0-b5dc-4a58-bab2-44bc7064b83b"...
# exoscale_security_group.webapp_public["80"]: Import prepared!
#   Prepared exoscale_security_group_rule for import
# exoscale_security_group_rule.webapp_public["80"]: Refreshing state... [id=0a187bd0-b5dc-4a58-bab2-44bc7064b83b]
#
# Import successful!
#
# The resources that were imported are shown above. These resources are now in
# your Terraform state and will henceforth be managed by Terraform.
```

In order to check this result and display details on newly imported rules, we have to run [`terraform plan`](https://www.terraform.io/docs/commands/plan.html):

```bash
terraform apply
# [output]
# exoscale_security_group.webapp: Refreshing state... [id=b83fe506-51e6-4933-8e70-205df6b640fa]
# exoscale_security_group.bastion: Refreshing state... [id=e1654b58-64f6-4efc-b8d9-7bbda86a83fa]
# exoscale_security_group_rule.webapp_ssh: Refreshing state... [id=5dafa58d-ba4d-4990-b66d-2996782ee3f3]
# exoscale_security_group_rule.webapp_public["80"]: Refreshing state... [id=0a187bd0-b5dc-4a58-bab2-44bc7064b83b]
# exoscale_security_group_rule.webapp_public["443"]: Refreshing state... [id=e7bbda2b-3c93-4693-a54c-465ac28bda59]
#
# No changes. Your infrastructure matches the configuration.
#
# Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
```

Here we can see that our configuration is matching the state: no resources will be changed.
Now we have finished replacing `exoscale_security_group_rules` with a set of `exoscale_security_group_rule`.
Our Terraform state matches the related configuration, so migration is completely done.

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-ssh-keypair/

---

# Migrating from ssh_keypair to ssh_key

-> This migration guide applies to Exoscale Terraform Provider **version 0.31.0 to 0.53.2**.

This page helps you migrate from an `exoscale_ssh_keypair` resource (deprecated) to the new
`exoscale_ssh_key`.

Unlike its predecessor, the `exoscale_ssh_key` resource doesn't support generating private keys
and only allows the registration of an existing (public) key in your Exoscale account.

Should you need to generate a key _pair_ (public and private key), we invite you to use the generic
[tls_private_key][tls_private_key] and the resource's `public_key_openssh` output along Exoscale
`exoscale_ssh_key`. Example given:

```terraform
resource "tls_private_key" "my_ssh_key" {
  algorithm = "ED25519"
}

resource "exoscale_ssh_key" "my_ssh_key" {
  name       = "my-ssh-key"
  public_key = tls_private_key.my_ssh_key.public_key_openssh
}
```

[tls_private_key]: https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key

**WARNING:** Should you generate an `RSA` key pair, make sure your SSH _client_ supports SHA2 -
`rsa-sha2-256` or `rsa-sha2-512` - when talking to SSH servers which might have disabled support
for SHA1 (example given [OpenSSH 8.8 and above](https://www.openssh.com/txt/release-8.8))!

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-sks-list-datasources-from-v0_72_x-to-v0_73_x/

---

# Migrating SKS List Data Sources from v0.72.x to v0.73.x

This guide covers the migration of the `exoscale_sks_cluster_list` and `exoscale_sks_nodepool_list` data sources from provider version ~> 0.72.x to ~> 0.73.x.

## Overview

Version 0.73.0 migrates `exoscale_sks_cluster_list` and `exoscale_sks_nodepool_list` from the legacy SDKv2 implementation to the Terraform plugin framework, continuing the SKS migration started with `exoscale_sks_cluster`, `exoscale_sks_nodepool` and `exoscale_sks_kubeconfig` in a previous release.

As part of this migration, both data sources drop their generic, per-attribute filter arguments: `zone` is now the only input they accept, and they always return every cluster / node pool found in that zone. If you relied on server-side filtering, filter the returned list yourself with a Terraform `for` expression instead. A handful of attributes on the returned list items were also removed, and a few on `exoscale_sks_nodepool_list` are now populated correctly for the first time — see below.

Since these are data sources, there is no resource state to carry forward or upgrade: they are fully re-read on every `plan`/`apply`. The breaking change is entirely in your configuration — the arguments you pass in, and the attributes you reference from the result — not in any stored state.

~> **Note:** Before migrating your configuration you need to ensure you use the latest version of Terraform and have a clean configuration.

## What has Changed

### Filtering is no longer built in

Previously, every attribute of a cluster/node pool doubled as an optional top-level filter argument on the list data source (with regex support via `/.../`). That's gone: both data sources now only accept `zone` (and `timeouts`) as input, and always return the full list for that zone.

**Before (v0.72.x):**
```hcl
data "exoscale_sks_cluster_list" "prod" {
  zone = "de-fra-1"
  labels = {
    "customer" = "/.*telecom.*/"
  }
}
```

**After (v0.73.x):**
```hcl
data "exoscale_sks_cluster_list" "all" {
  zone = "de-fra-1"
}

locals {
  prod_clusters = [
    for c in data.exoscale_sks_cluster_list.all.clusters :
    c if can(regex(".*telecom.*", lookup(c.labels, "customer", "")))
  ]
}
```

The same applies to `exoscale_sks_nodepool_list`:

**Before (v0.72.x):**
```hcl
data "exoscale_sks_nodepool_list" "workers" {
  zone = "de-fra-1"
  name = "/.*-workers-.*/"
}
```

**After (v0.73.x):**
```hcl
data "exoscale_sks_nodepool_list" "all" {
  zone = "de-fra-1"
}

locals {
  worker_nodepools = [
    for np in data.exoscale_sks_nodepool_list.all.nodepools :
    np if can(regex(".*-workers-.*", np.name))
  ]
}
```

### Removed attributes on `exoscale_sks_cluster_list` items

The following attributes have been removed from each entry of `clusters`: `aggregation_ca`, `audit`, `control_plane_ca`, `create_default_security_group`, `enable_karpenter`, `exoscale_ccm`, `exoscale_csi`, `kubelet_ca`, `metrics_server`, `oidc`, and the per-item `zone` (redundant with the data source's own `zone` argument). These attributes were declared in the legacy schema but never actually populated by the provider, so they always read as an empty or zero value — no real data is lost. If you need any of them, look up the specific cluster with the [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster/index.md) data source instead.

### `exoscale_sks_nodepool_list` items: one removed, some fixed, one new

The per-item `zone` attribute was removed, same as above (redundant with the data source's own `zone` argument).

`storage_lvm`, `ipv6`, `template_id` and `kubelet_image_gc` are now populated from each node pool's actual state. Previously they were declared in the schema but never set by the provider, so they always read as `false`/empty regardless of the real node pool configuration — if your configuration depended on that always-empty behavior, double check it against the real values.

A new `cluster_id` attribute is now populated on each item, identifying which `exoscale_sks_cluster` the node pool belongs to. This existed in the legacy schema too, but only as an input-only filter argument that could never actually match anything (it was never compared against real node pool data), so it silently returned an empty list whenever used. It's now a real, always-populated output attribute.

## Migration Steps

### 1. Update Provider Version

```hcl
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
      version = "~> 0.73.0"
    }
  }
}
```

### 2. Replace filter arguments with a `for` expression

For every `exoscale_sks_cluster_list` or `exoscale_sks_nodepool_list` data source that sets an argument other than `zone` (or `timeouts`), remove it and instead filter the `clusters`/`nodepools` list yourself, as shown above.

### 3. Remove references to dropped attributes

Search your configuration for the removed `clusters[*]` attributes listed above (`aggregation_ca`, `audit`, `control_plane_ca`, `create_default_security_group`, `enable_karpenter`, `exoscale_ccm`, `exoscale_csi`, `kubelet_ca`, `metrics_server`, `oidc`) and the per-item `zone` on both data sources, and remove them.

### 4. Verify Changes

After updating your configuration:

1. Run `terraform init -upgrade` to upgrade the provider.
2. Run `terraform plan` to verify there are no further changes beyond what you expect from the newly-populated `exoscale_sks_nodepool_list` attributes.

You should see output similar to:

```
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
```

## Additional Resources
- [exoscale_sks_cluster_list Data Source](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/data-sources/sks_cluster_list)
- [exoscale_sks_nodepool_list Data Source](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/data-sources/sks_nodepool_list)

---

url: https://community.exoscale.com/reference/terraform/provider/guides/migration-of-sks-nodepool-from-v0_72_x-to-v0_73_x/

---

# Migrating SKS Node Pool from v0.72.x to v0.73.x

This guide covers the migration of `exoscale_sks_nodepool` (resource and data source) from provider version ~> 0.72.x to ~> 0.73.x.

## Overview

Version 0.73.0 migrates `exoscale_sks_nodepool` (resource and data source) from the legacy SDKv2 implementation to the Terraform plugin framework, continuing the migration started with `exoscale_sks_cluster` in a previous release.

As part of this migration, the `kubelet_image_gc` argument changes from a repeatable block to an attribute assignment, so that it can properly reflect the cluster's effective kubelet image garbage collection policy (including platform defaults) instead of only echoing back what you explicitly configured.

Your Terraform state is upgraded automatically the next time you run `plan` or `apply` — no `terraform state` surgery, and no resources are recreated.

~> **Note:** Before migrating resources you need to ensure you use the latest version of Terraform and have a clean configuration.

## What has Changed

### `kubelet_image_gc` Syntax

`kubelet_image_gc` now uses attribute assignment syntax (`=`) with an object, instead of nested block syntax.

**Before (v0.72.x):**
```hcl
resource "exoscale_sks_nodepool" "my_sks_nodepool" {
  # ...

  kubelet_image_gc {
    min_age        = "1h"
    high_threshold = 85
    low_threshold  = 80
  }
}
```

**After (v0.73.x):**
```hcl
resource "exoscale_sks_nodepool" "my_sks_nodepool" {
  # ...

  kubelet_image_gc = {
    min_age        = "1h"
    high_threshold = 85
    low_threshold  = 80
  }
}
```

If your configuration doesn't set `kubelet_image_gc`, no change is required: the attribute is optional either way.

## Migration Steps

### 1. Update Provider Version

```hcl
terraform {
  required_providers {
    exoscale = {
      source  = "exoscale/exoscale"
      version = "~> 0.73.0"
    }
  }
}
```

### 2. Update `kubelet_image_gc` Syntax

For every `exoscale_sks_nodepool` resource that sets `kubelet_image_gc`, add an equals sign (`=`) after the argument name, as shown above.

### 3. Verify Changes

After updating your configuration:

1. Run `terraform init -upgrade` to upgrade the provider.
2. Run `terraform apply -refresh-only` once. Terraform silently upgrades the on-disk/remote state of every `exoscale_sks_nodepool` resource to the new schema as part of this refresh.
3. Run `terraform plan` to verify there are no further changes.

You should see output similar to:

```
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.
```

## Additional Resources
- [exoscale_sks_nodepool Resource](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/resources/sks_nodepool)
- [exoscale_sks_nodepool Data Source](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs/data-sources/sks_nodepool)

---

url: https://community.exoscale.com/reference/terraform/provider/resources/

---

# Resources



---

url: https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/

---

# exoscale_anti_affinity_group (Resource)

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

Corresponding data source: [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/data-sources/anti_affinity_group/index.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

### 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
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/block_storage_volume/

---

# exoscale_block_storage_volume (Resource)

Manage [Exoscale Block Storage](https://community.exoscale.com/product/storage/block-storage/index.md) Volume.

Block Storage offers persistent externally attached volumes for your workloads.




## Schema

### Required

- `name` (String) Volume name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `labels` (Map of String) Resource labels.
- `size` (Number) Volume size in GB (default 10). If volume is attached, instance must be stopped to update this value. Volume can only grow, cannot be shrunk.
- `snapshot_target` (Attributes) Block storage snapshot to use when creating a volume. Read-only after creation. (see [below for nested schema](#nestedatt--snapshot_target))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `blocksize` (Number) Volume block size.
- `created_at` (String) Volume creation date.
- `id` (String) The ID of this resource.
- `state` (String) Volume state.

<a id="nestedatt--snapshot_target"></a>
### Nested Schema for `snapshot_target`

Optional:

- `id` (String) Snapshot ID.


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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/block_storage_volume_snapshot/

---

# exoscale_block_storage_volume_snapshot (Resource)

Manage [Exoscale Block Storage](https://community.exoscale.com/product/storage/block-storage/index.md) Volume Snapshot.

Block Storage offers persistent externally attached volumes for your workloads.




## Schema

### Required

- `name` (String) Volume snapshot name.
- `volume` (Attributes) Volume from which to create a snapshot. (see [below for nested schema](#nestedatt--volume))
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `labels` (Map of String) Resource labels.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `created_at` (String) Snapshot creation date.
- `id` (String) The ID of this resource.
- `size` (Number) Snapshot size in GB.
- `state` (String) Snapshot state.

<a id="nestedatt--volume"></a>
### Nested Schema for `volume`

Required:

- `id` (String) Snapshot ID.


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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/compute_instance/

---

# exoscale_compute_instance (Resource)

Manage Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/).

Corresponding data sources: [exoscale_compute_instance](https://community.exoscale.com/reference/terraform/provider/data-sources/compute_instance/index.md), [exoscale_compute_instance_list](https://community.exoscale.com/reference/terraform/provider/data-sources/compute_instance_list/index.md).

After the creation, you can retrieve the password of an instance with [Exoscale CLI](https://github.com/exoscale/cli): `exo compute instance reveal-password NAME`.

## Example Usage

```terraform
data "exoscale_template" "my_template" {
  zone = "ch-gva-2"
  name = "Linux Ubuntu 22.04 LTS 64-bit"
}

resource "exoscale_compute_instance" "my_instance" {
  zone = "ch-gva-2"
  name = "my-instance"

  template_id = data.exoscale_template.my_template.id
  type        = "standard.medium"
  disk_size   = 10
}
```

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


## Schema

### Required

- `disk_size` (Number) The instance disk size (GiB; at least `10`). Can not be decreased after creation. **WARNING**: updating this attribute stops/restarts the instance.
- `name` (String) The compute instance name.
- `template_id` (String) ❗ The [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md) (ID) to use when creating the instance.
- `type` (String) The instance type (`<family>.<size>`, e.g. `standard.medium`; use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo compute instance-type list` - for the list of available types). **WARNING**: updating this attribute stops/restarts the instance.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `anti_affinity_group_ids` (Set of String) ❗ A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs) to attach to the instance (may only be set at creation time).
- `block_storage_volume_ids` (Set of String) A list of [exoscale_block_storage_volume](https://community.exoscale.com/reference/terraform/provider/resources/block_storage_volume/index.md) (ID) to attach to the instance.
- `deploy_target_id` (String) ❗ A deploy target ID.
- `destroy_protected` (Boolean) Mark the instance as protected, the Exoscale API will refuse to delete the instance until the protection is removed (boolean; default: `false`).
- `elastic_ip_ids` (Set of String) A list of [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md) (IDs) to attach to the instance.
- `enable_secure_boot` (Boolean) ❗ Enable secure boot on the instance (boolean; default: `false`). Can not be changed after the creation.
- `enable_tpm` (Boolean) Enable TPM on the instance (boolean; default: `false`). Can not be disabled after the creation. **WARNING**: enabling this attribute stops/restarts the instance.
- `ipv6` (Boolean) Enable IPv6 on the instance (boolean; default: `false`). Can not be disabled after being enabled.
- `labels` (Map of String) A map of key/value labels.
- `network_interface` (Block Set) Private network interfaces (may be specified multiple times). Structure is documented below. (see [below for nested schema](#nestedblock--network_interface))
- `private` (Boolean) Whether the instance is private (no public IP addresses; default: false)
- `reverse_dns` (String) Domain name for reverse DNS record.
- `security_group_ids` (Set of String) A list of [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs) to attach to the instance.
- `ssh_key` (String, Deprecated) ❗ The [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) to authorize in the instance (may only be set at creation time).
- `ssh_keys` (Set of String) ❗ The list of [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) to authorize in the instance (may only be set at creation time).
- `state` (String) The instance state (`running` or `stopped`). If omitted, instance will start and reach `running` state.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `user_data` (String) [cloud-init](https://cloudinit.readthedocs.io/) configuration.

### Read-Only

- `created_at` (String) The instance creation date.
- `id` (String) The ID of this resource.
- `ipv6_address` (String) The instance (main network interface) IPv6 address (if enabled).
- `mac_address` (String) MAC address
- `private_network_ids` (Set of String, Deprecated) A list of private networks (IDs) attached to the instance. Please use the `network_interface.*.network_id` argument instead.
- `public_ip_address` (String) The instance (main network interface) IPv4 address.

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

Required:

- `network_id` (String) The [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (ID) to attach to the instance.

Optional:

- `ip_address` (String) The IPv4 address to request as static DHCP lease if the network interface is attached to a *managed* private network.

Read-Only:

- `mac_address` (String) MAC address


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing compute instance may be imported by `<ID>@<zone>`:

terraform import \
  exoscale_compute_instance.my_instance \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/database/

---

# exoscale_database (Resource)

❗This resource is deprecated and renamed to exoscale_dbaas, do not use it to create new resources❗
Manage Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).

## Example Usage

```terraform
resource "exoscale_database" "my_database" {
  zone = "ch-gva-2"
  name = "my-database"

  type = "pg"
  plan = "startup-4"

  maintenance_dow  = "sunday"
  maintenance_time = "23:00:00"

  termination_protection = true

  pg = {
    version = "13"

    backup_schedule = "04:00"

    ip_filter = [
      "1.2.3.4/32",
      "5.6.7.8/32",
    ]

    pg_settings = jsonencode({
      timezone : "Europe/Zurich"
    })
  }
}
```

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


## Schema

### Required

- `name` (String) ❗ The name of the database service.
- `plan` (String) The plan of the database service (use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo dbaas type show <TYPE> --plans` - for reference).
- `type` (String) The type of the database service (`clickhouse`, `kafka`, `mysql`, `opensearch`, `pg`, `valkey`, `grafana`).
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `clickhouse` (Attributes) *clickhouse* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--clickhouse))
- `grafana` (Attributes) *grafana* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--grafana))
- `kafka` (Attributes) *kafka* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--kafka))
- `maintenance_dow` (String) The day of week to perform the automated database service maintenance (`never`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`).
- `maintenance_time` (String) The time of day to perform the automated database service maintenance (`HH:MM:SS`)
- `mysql` (Attributes) *mysql* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--mysql))
- `opensearch` (Attributes) *opensearch* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--opensearch))
- `pg` (Attributes) *pg* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--pg))
- `termination_protection` (Boolean) The database service protection boolean flag against termination/power-off.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `valkey` (Attributes) *valkey* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--valkey))

### Read-Only

- `ca_certificate` (String, Sensitive) CA Certificate required to reach a DBaaS service through a TLS-protected connection.
- `created_at` (String) The creation date of the database service.
- `disk_size` (Number) The disk size of the database service.
- `id` (String) The ID of this resource.
- `node_cpus` (Number) The number of CPUs of the database service.
- `node_memory` (Number) The amount of memory of the database service.
- `nodes` (Number) The number of nodes of the database service.
- `state` (String) The current state of the database service.
- `updated_at` (String) The date of the latest database service update.
- `uri` (String) The service uri stripped from credentials

<a id="nestedatt--clickhouse"></a>
### Nested Schema for `clickhouse`

Optional:

- `clickhouse_settings` (String) ClickHouse configuration settings in JSON format (`exo dbaas type show clickhouse --settings=clickhouse` for reference).
- `fork_from_service` (String) Name of an existing ClickHouse service to fork from. Cannot be changed after creation.
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `recovery_backup_name` (String) Name of the backup to restore when forking from `fork_from_service`.
- `version` (String) ClickHouse major version (`exo dbaas type show clickhouse` for reference).


<a id="nestedatt--grafana"></a>
### Nested Schema for `grafana`

Optional:

- `grafana_settings` (String) Grafana configuration settings in JSON format (`exo dbaas type show grafana --settings=grafana` for reference).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.


<a id="nestedatt--kafka"></a>
### Nested Schema for `kafka`

Optional:

- `enable_cert_auth` (Boolean) Enable certificate-based authentication method.
- `enable_kafka_connect` (Boolean) Enable Kafka Connect.
- `enable_kafka_rest` (Boolean) Enable Kafka REST.
- `enable_sasl_auth` (Boolean) Enable SASL-based authentication method.
- `enable_schema_registry` (Boolean) Enable Schema Registry.
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `kafka_connect_settings` (String) Kafka Connect configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka-connect` for reference).
- `kafka_rest_settings` (String) Kafka REST configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka-rest` for reference).
- `kafka_settings` (String) Kafka configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka` for reference).
- `schema_registry_settings` (String) Schema Registry configuration settings in JSON format (`exo dbaas type show kafka --settings=schema-registry` for reference)
- `version` (String) Kafka major version (`exo dbaas type show kafka` for reference; may only be set at creation time).


<a id="nestedatt--mysql"></a>
### Nested Schema for `mysql`

Optional:

- `admin_password` (String, Sensitive) A custom administrator account password (may only be set at creation time).
- `admin_username` (String) A custom administrator account username (may only be set at creation time).
- `backup_schedule` (String) The automated backup schedule (`HH:MM`).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `mysql_settings` (String) MySQL configuration settings in JSON format (`exo dbaas type show mysql --settings=mysql` for reference).
- `version` (String) MySQL major version (`exo dbaas type show mysql` for reference; may only be set at creation time).


<a id="nestedatt--opensearch"></a>
### Nested Schema for `opensearch`

Optional:

- `dashboards` (Attributes) OpenSearch Dashboards settings (see [below for nested schema](#nestedatt--opensearch--dashboards))
- `fork_from_service` (String) ❗ Service name
- `index_pattern` (Attributes List) (can be used multiple times) Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like 'logs.?' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note 'logs.?' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored. (see [below for nested schema](#nestedatt--opensearch--index_pattern))
- `index_template` (Attributes) Template settings for all new indexes (see [below for nested schema](#nestedatt--opensearch--index_template))
- `ip_filter` (Set of String) Allow incoming connections from this list of CIDR address block, e.g. `["10.20.0.0/16"]
- `keep_index_refresh_interval` (Boolean) Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.
- `max_index_count` (Number, Deprecated) Maximum number of indexes to keep (Minimum value is `0`)
- `recovery_backup_name` (String) ❗ Name of a backup to recover from
- `settings` (String) OpenSearch-specific settings, in json. e.g.`jsonencode({thread_pool_search_size: 64})`. Use `exo x get-dbaas-settings-opensearch` to get a list of available settings.
- `version` (String) ❗ OpenSearch major version (`exo dbaas type show opensearch` for reference)

<a id="nestedatt--opensearch--dashboards"></a>
### Nested Schema for `opensearch.dashboards`

Optional:

- `enabled` (Boolean) Enable or disable OpenSearch Dashboards (default: true).
- `max_old_space_size` (Number) Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128).
- `request_timeout` (Number) Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)


<a id="nestedatt--opensearch--index_pattern"></a>
### Nested Schema for `opensearch.index_pattern`

Optional:

- `max_index_count` (Number) Maximum number of indexes to keep before deleting the oldest one (Minimum value is `0`)
- `pattern` (String) fnmatch pattern
- `sorting_algorithm` (String) `alphabetical` or `creation_date`.


<a id="nestedatt--opensearch--index_template"></a>
### Nested Schema for `opensearch.index_template`

Optional:

- `mapping_nested_objects_limit` (Number) The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. (Default is 10000. Minimum value is `0`, maximum value is `100000`.)
- `number_of_replicas` (Number) The number of replicas each primary shard has. (Minimum value is `0`, maximum value is `29`)
- `number_of_shards` (Number) The number of primary shards that an index should have. (Minimum value is `1`, maximum value is `1024`.)



<a id="nestedatt--pg"></a>
### Nested Schema for `pg`

Optional:

- `admin_password` (String, Sensitive) A custom administrator account password (may only be set at creation time).
- `admin_username` (String) A custom administrator account username (may only be set at creation time).
- `backup_schedule` (String) The automated backup schedule (`HH:MM`).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `pg_settings` (String) PostgreSQL configuration settings in JSON format (`exo dbaas type show pg --settings=pg` for reference).
- `pgbouncer_settings` (String) PgBouncer configuration settings in JSON format (`exo dbaas type show pg --settings=pgbouncer` for reference).
- `pglookout_settings` (String) pglookout configuration settings in JSON format (`exo dbaas type show pg --settings=pglookout` for reference).
- `recovery_backup_time` (String) ISO time of a backup to recover from. May only be set at creation time.
- `shared_buffers_percentage` (Number) Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60, which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.
- `timescaledb_settings` (String) TimescaleDB extension configuration settings in JSON format (`exo dbaas type show pg --settings=timescaledb` for reference).
- `variant` (String) PostgreSQL variant (`timescale` or `aiven`). May only be set at creation time.
- `version` (String) PostgreSQL major version (`exo dbaas type show pg` for reference; may only be set at creation time).
- `work_mem` (Number) Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).


<a id="nestedatt--valkey"></a>
### Nested Schema for `valkey`

Optional:

- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `valkey_settings` (String) Valkey configuration settings in JSON format (`exo dbaas type show valkey --settings=valkey` for reference).

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

## Import

```shell
# An existing database service may be imported by `<name>@<zone>`:

terraform import \
  exoscale_database.my_database \
  my-database@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas/

---

# exoscale_dbaas (Resource)

Manage Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `name` (String) ❗ The name of the database service.
- `plan` (String) The plan of the database service (use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo dbaas type show <TYPE> --plans` - for reference).
- `type` (String) The type of the database service (`clickhouse`, `kafka`, `mysql`, `opensearch`, `pg`, `valkey`, `grafana`).
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `clickhouse` (Attributes) *clickhouse* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--clickhouse))
- `grafana` (Attributes) *grafana* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--grafana))
- `kafka` (Attributes) *kafka* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--kafka))
- `maintenance_dow` (String) The day of week to perform the automated database service maintenance (`never`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`).
- `maintenance_time` (String) The time of day to perform the automated database service maintenance (`HH:MM:SS`)
- `mysql` (Attributes) *mysql* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--mysql))
- `opensearch` (Attributes) *opensearch* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--opensearch))
- `pg` (Attributes) *pg* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--pg))
- `termination_protection` (Boolean) The database service protection boolean flag against termination/power-off.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `valkey` (Attributes) *valkey* database service type specific arguments. Structure is documented below. (see [below for nested schema](#nestedatt--valkey))

### Read-Only

- `ca_certificate` (String, Sensitive) CA Certificate required to reach a DBaaS service through a TLS-protected connection.
- `created_at` (String) The creation date of the database service.
- `disk_size` (Number) The disk size of the database service.
- `id` (String) The ID of this resource.
- `node_cpus` (Number) The number of CPUs of the database service.
- `node_memory` (Number) The amount of memory of the database service.
- `nodes` (Number) The number of nodes of the database service.
- `state` (String) The current state of the database service.
- `updated_at` (String) The date of the latest database service update.
- `uri` (String) The service uri stripped from credentials

<a id="nestedatt--clickhouse"></a>
### Nested Schema for `clickhouse`

Optional:

- `clickhouse_settings` (String) ClickHouse configuration settings in JSON format (`exo dbaas type show clickhouse --settings=clickhouse` for reference).
- `fork_from_service` (String) Name of an existing ClickHouse service to fork from. Cannot be changed after creation.
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `recovery_backup_name` (String) Name of the backup to restore when forking from `fork_from_service`.
- `version` (String) ClickHouse major version (`exo dbaas type show clickhouse` for reference).


<a id="nestedatt--grafana"></a>
### Nested Schema for `grafana`

Optional:

- `grafana_settings` (String) Grafana configuration settings in JSON format (`exo dbaas type show grafana --settings=grafana` for reference).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.


<a id="nestedatt--kafka"></a>
### Nested Schema for `kafka`

Optional:

- `enable_cert_auth` (Boolean) Enable certificate-based authentication method.
- `enable_kafka_connect` (Boolean) Enable Kafka Connect.
- `enable_kafka_rest` (Boolean) Enable Kafka REST.
- `enable_sasl_auth` (Boolean) Enable SASL-based authentication method.
- `enable_schema_registry` (Boolean) Enable Schema Registry.
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `kafka_connect_settings` (String) Kafka Connect configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka-connect` for reference).
- `kafka_rest_settings` (String) Kafka REST configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka-rest` for reference).
- `kafka_settings` (String) Kafka configuration settings in JSON format (`exo dbaas type show kafka --settings=kafka` for reference).
- `schema_registry_settings` (String) Schema Registry configuration settings in JSON format (`exo dbaas type show kafka --settings=schema-registry` for reference)
- `version` (String) Kafka major version (`exo dbaas type show kafka` for reference; may only be set at creation time).


<a id="nestedatt--mysql"></a>
### Nested Schema for `mysql`

Optional:

- `admin_password` (String, Sensitive) A custom administrator account password (may only be set at creation time).
- `admin_username` (String) A custom administrator account username (may only be set at creation time).
- `backup_schedule` (String) The automated backup schedule (`HH:MM`).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `mysql_settings` (String) MySQL configuration settings in JSON format (`exo dbaas type show mysql --settings=mysql` for reference).
- `version` (String) MySQL major version (`exo dbaas type show mysql` for reference; may only be set at creation time).


<a id="nestedatt--opensearch"></a>
### Nested Schema for `opensearch`

Optional:

- `dashboards` (Attributes) OpenSearch Dashboards settings (see [below for nested schema](#nestedatt--opensearch--dashboards))
- `fork_from_service` (String) ❗ Service name
- `index_pattern` (Attributes List) (can be used multiple times) Allows you to create glob style patterns and set a max number of indexes matching this pattern you want to keep. Creating indexes exceeding this value will cause the oldest one to get deleted. You could for example create a pattern looking like 'logs.?' and then create index logs.1, logs.2 etc, it will delete logs.1 once you create logs.6. Do note 'logs.?' does not apply to logs.10. Note: Setting max_index_count to 0 will do nothing and the pattern gets ignored. (see [below for nested schema](#nestedatt--opensearch--index_pattern))
- `index_template` (Attributes) Template settings for all new indexes (see [below for nested schema](#nestedatt--opensearch--index_template))
- `ip_filter` (Set of String) Allow incoming connections from this list of CIDR address block, e.g. `["10.20.0.0/16"]
- `keep_index_refresh_interval` (Boolean) Aiven automation resets index.refresh_interval to default value for every index to be sure that indices are always visible to search. If it doesn't fit your case, you can disable this by setting up this flag to true.
- `max_index_count` (Number, Deprecated) Maximum number of indexes to keep (Minimum value is `0`)
- `recovery_backup_name` (String) ❗ Name of a backup to recover from
- `settings` (String) OpenSearch-specific settings, in json. e.g.`jsonencode({thread_pool_search_size: 64})`. Use `exo x get-dbaas-settings-opensearch` to get a list of available settings.
- `version` (String) ❗ OpenSearch major version (`exo dbaas type show opensearch` for reference)

<a id="nestedatt--opensearch--dashboards"></a>
### Nested Schema for `opensearch.dashboards`

Optional:

- `enabled` (Boolean) Enable or disable OpenSearch Dashboards (default: true).
- `max_old_space_size` (Number) Limits the maximum amount of memory (in MiB) the OpenSearch Dashboards process can use. This sets the max_old_space_size option of the nodejs running the OpenSearch Dashboards. Note: the memory reserved by OpenSearch Dashboards is not available for OpenSearch. (default: 128).
- `request_timeout` (Number) Timeout in milliseconds for requests made by OpenSearch Dashboards towards OpenSearch (default: 30000)


<a id="nestedatt--opensearch--index_pattern"></a>
### Nested Schema for `opensearch.index_pattern`

Optional:

- `max_index_count` (Number) Maximum number of indexes to keep before deleting the oldest one (Minimum value is `0`)
- `pattern` (String) fnmatch pattern
- `sorting_algorithm` (String) `alphabetical` or `creation_date`.


<a id="nestedatt--opensearch--index_template"></a>
### Nested Schema for `opensearch.index_template`

Optional:

- `mapping_nested_objects_limit` (Number) The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out of memory errors when a document contains too many nested objects. (Default is 10000. Minimum value is `0`, maximum value is `100000`.)
- `number_of_replicas` (Number) The number of replicas each primary shard has. (Minimum value is `0`, maximum value is `29`)
- `number_of_shards` (Number) The number of primary shards that an index should have. (Minimum value is `1`, maximum value is `1024`.)



<a id="nestedatt--pg"></a>
### Nested Schema for `pg`

Optional:

- `admin_password` (String, Sensitive) A custom administrator account password (may only be set at creation time).
- `admin_username` (String) A custom administrator account username (may only be set at creation time).
- `backup_schedule` (String) The automated backup schedule (`HH:MM`).
- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `pg_settings` (String) PostgreSQL configuration settings in JSON format (`exo dbaas type show pg --settings=pg` for reference).
- `pgbouncer_settings` (String) PgBouncer configuration settings in JSON format (`exo dbaas type show pg --settings=pgbouncer` for reference).
- `pglookout_settings` (String) pglookout configuration settings in JSON format (`exo dbaas type show pg --settings=pglookout` for reference).
- `recovery_backup_time` (String) ISO time of a backup to recover from. May only be set at creation time.
- `shared_buffers_percentage` (Number) Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60, which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.
- `timescaledb_settings` (String) TimescaleDB extension configuration settings in JSON format (`exo dbaas type show pg --settings=timescaledb` for reference).
- `variant` (String) PostgreSQL variant (`timescale` or `aiven`). May only be set at creation time.
- `version` (String) PostgreSQL major version (`exo dbaas type show pg` for reference; may only be set at creation time).
- `work_mem` (Number) Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).


<a id="nestedatt--valkey"></a>
### Nested Schema for `valkey`

Optional:

- `ip_filter` (Set of String) A list of CIDR blocks to allow incoming connections from.
- `valkey_settings` (String) Valkey configuration settings in JSON format (`exo dbaas type show valkey --settings=valkey` for reference).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_clickhouse_user/

---

# exoscale_dbaas_clickhouse_user (Resource)

Manage service users for a ClickHouse Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `password` (String, Sensitive) The password of the ClickHouse user. If not set, the API will generate one. Cannot be retrieved after creation (use the generated value or reset via update).
- `roles` (Attributes Set) Roles granted to the user. Each role is identified by its UUID. (see [below for nested schema](#nestedatt--roles))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/username
- `type` (String) The type of the service user.
- `user_uuid` (String) The UUID of the ClickHouse user (internal, used for delete).

<a id="nestedatt--roles"></a>
### Nested Schema for `roles`

Required:

- `uuid` (String) The UUID of the role to grant.


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_endpoint_datadog/

---

# exoscale_dbaas_external_endpoint_datadog (Resource)

Manage Exoscale DBaaS [External Endpoint](https://community.exoscale.com/documentation/dbaas/) for Datadog integration.




## Schema

### Required

- `datadog_api_key` (String, Sensitive) ❗ Datadog API key.
- `name` (String) ❗ The endpoint name.
- `site` (String) Datadog site (`datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, `ap1.datadoghq.com`, `ddog-gov.com`).
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_endpoint_elasticsearch/

---

# exoscale_dbaas_external_endpoint_elasticsearch (Resource)

Manage Exoscale DBaaS [External Endpoint](https://community.exoscale.com/documentation/dbaas/) for Elasticsearch logs integration.




## Schema

### Required

- `index_prefix` (String) Elasticsearch index prefix.
- `name` (String) ❗ The endpoint name.
- `url` (String) Elasticsearch connection URL.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `ca` (String, Sensitive) PEM encoded CA certificate.
- `index_days_max` (Number) Maximum number of days of logs to keep (1-10000).
- `timeout` (Number) Elasticsearch request timeout in seconds (10-120).
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_endpoint_opensearch/

---

# exoscale_dbaas_external_endpoint_opensearch (Resource)

Manage Exoscale DBaaS [External Endpoint](https://community.exoscale.com/documentation/dbaas/) for OpenSearch logs integration.




## Schema

### Required

- `index_prefix` (String) OpenSearch index prefix.
- `name` (String) ❗ The endpoint name.
- `url` (String) OpenSearch connection URL.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `ca` (String, Sensitive) PEM encoded CA certificate.
- `index_days_max` (Number) Maximum number of days of logs to keep (1-10000).
- `timeout` (Number) OpenSearch request timeout in seconds (10-120).
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_endpoint_prometheus/

---

# exoscale_dbaas_external_endpoint_prometheus (Resource)

Manage Exoscale DBaaS [External Endpoint](https://community.exoscale.com/documentation/dbaas/) for Prometheus metrics integration.




## Schema

### Required

- `name` (String) ❗ The endpoint name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `basic_auth_password` (String, Sensitive) Prometheus basic auth password (8-64 characters). Not returned by the API after creation.
- `basic_auth_username` (String) Prometheus basic auth username (5-32 characters).
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_endpoint_rsyslog/

---

# exoscale_dbaas_external_endpoint_rsyslog (Resource)

Manage Exoscale DBaaS [External Endpoint](https://community.exoscale.com/documentation/dbaas/) for Rsyslog logs integration.




## Schema

### Required

- `format` (String) Syslog message format (`rfc3164`, `rfc5424`, `custom`).
- `name` (String) ❗ The endpoint name.
- `port` (Number) Rsyslog server port (1-65535).
- `server` (String) Rsyslog server IP address or hostname.
- `tls` (Boolean) Require TLS.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `ca` (String, Sensitive) PEM encoded CA certificate.
- `cert` (String, Sensitive) PEM encoded client certificate.
- `key` (String, Sensitive) PEM encoded client key.
- `logline` (String) Custom syslog message format (required when format is `custom`).
- `max_message_size` (Number) Rsyslog max message size (2048-2147483647).
- `sd` (String) Structured data block for log message.
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_external_integration/

---

# exoscale_dbaas_external_integration (Resource)

Manage Exoscale DBaaS [External Integrations](https://community.exoscale.com/documentation/dbaas/) — attach a DBaaS service to an external endpoint for log/metrics forwarding.




## Schema

### Required

- `dest_endpoint_id` (String) ❗ The UUID of the external endpoint to attach the integration to.
- `source_service_name` (String) ❗ The name of the DBaaS service to integrate.
- `type` (String) ❗ The type of the external endpoint.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `description` (String) Integration description.
- `dest_endpoint_name` (String) Name of the destination endpoint.
- `id` (String) The ID of this resource (integration UUID).
- `source_service_type` (String) Type of the source DBaaS service.
- `status` (String) Integration status.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_kafka_user/

---

# exoscale_dbaas_kafka_user (Resource)

Manage service users for a Kafka Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `access_cert` (String, Sensitive) Access certificate for the user.
- `access_cert_expiry` (String) Access certificate expiry date.
- `access_key` (String, Sensitive) Access certificate key for the user.
- `id` (String) The ID of this resource, computed as service/username
- `password` (String, Sensitive) The password of the service user.
- `type` (String) The type of the service user.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_mysql_database/

---

# exoscale_dbaas_mysql_database (Resource)

❗ Manage service database for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `database_name` (String) ❗ The name of the database for this service.
- `service` (String) ❗ The name of the database service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/database_name

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_mysql_user/

---

# exoscale_dbaas_mysql_user (Resource)

Manage service users for MySQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `authentication` (String) ❗ Authentication details. The possible values are `null`, `caching_sha2_password` and `mysql_native_password`.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/username
- `password` (String, Sensitive) The password of the service user.
- `type` (String) The type of the service user.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_opensearch_user/

---

# exoscale_dbaas_opensearch_user (Resource)

Manage service users for an Opensearch Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/username
- `password` (String, Sensitive) The password of the service user.
- `type` (String) The type of the service user.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_pg_connection_pool/

---

# exoscale_dbaas_pg_connection_pool (Resource)

Manage PostgreSQL PgBouncer connection pools for an Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `database_name` (String) ❗ The PostgreSQL database name targeted by this pool.
- `name` (String) ❗ The connection pool name.
- `service` (String) ❗ The name of the PostgreSQL database service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `mode` (String) The PgBouncer pool mode (`transaction`, `statement`, or `session`).
- `size` (Number) The connection pool size.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `username` (String) ❗ The PostgreSQL username used by this pool.

### Read-Only

- `connection_uri` (String, Sensitive) The connection URI for this pool.
- `id` (String) The ID of this resource, computed as `service/name`.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_pg_database/

---

# exoscale_dbaas_pg_database (Resource)

❗ Manage service database for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `database_name` (String) ❗ The name of the database for this service.
- `service` (String) ❗ The name of the database service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `lc_collate` (String) Default string sort order (LC_COLLATE) for PostgreSQL database
- `lc_ctype` (String) Default character classification (LC_CTYPE) for PostgreSQL database
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/database_name

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_pg_user/

---

# exoscale_dbaas_pg_user (Resource)

❗ Manage service users for a PostgreSQL Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `allow_replication` (Boolean) Allows replication
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/username
- `password` (String, Sensitive) The password of the service user.
- `type` (String) The type of the service user.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/dbaas_valkey_user/

---

# exoscale_dbaas_valkey_user (Resource)

Manage service users for a Valkey Exoscale [Database Services (DBaaS)](https://community.exoscale.com/documentation/dbaas/).




## Schema

### Required

- `service` (String) ❗ The name of the database service.
- `username` (String) ❗ The name of the user for this service.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource, computed as service/username
- `password` (String, Sensitive) The password of the service user.
- `type` (String) The type of the service user.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/domain/

---

# exoscale_domain (Resource)

Manage Exoscale [DNS](https://community.exoscale.com/product/networking/dns/index.md) Domains.

Corresponding data source: [exoscale_domain](https://community.exoscale.com/reference/terraform/provider/data-sources/domain/index.md).

## Example Usage

```terraform
resource "exoscale_domain" "my_domain" {
  name = "my.domain"
}
```

Next step is to attach [exoscale_domain_record](https://community.exoscale.com/reference/terraform/provider/resources/domain_record/index.md)(s) to the domain.

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


## Schema

### Required

- `name` (String) ❗ The DNS domain name.

### Optional

- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing DNS domain may be imported by `ID`:

```shell
terraform import \
  exoscale_domain.my_domain \
  89083a5c-b648-474a-0000-0000000f67bd
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/domain_record/

---

# exoscale_domain_record (Resource)

Manage Exoscale [DNS](https://community.exoscale.com/product/networking/dns/index.md) Domain Records.

Corresponding data source: [exoscale_domain_record](https://community.exoscale.com/reference/terraform/provider/data-sources/domain_record/index.md).

## Example Usage

```terraform
resource "exoscale_domain" "my_domain" {
  name = "example.net"
}

resource "exoscale_domain_record" "my_host" {
  domain      = exoscale_domain.my_domain.id
  name        = "my-host"
  record_type = "A"
  content     = "1.2.3.4"
}

resource "exoscale_domain_record" "my_host_alias" {
  domain      = exoscale_domain.my_domain.id
  name        = "my-host-alias"
  record_type = "CNAME"
  content     = exoscale_domain_record.my_host.hostname
}
```

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


## Schema

### Required

- `content` (String) The record value. Format follows specific record type. For example SRV record format would be `<weight> <port> <target>`
- `domain` (String) ❗ The parent [exoscale_domain](https://community.exoscale.com/reference/terraform/provider/resources/domain/index.md) to attach the record to.
- `name` (String) The record name, Leave blank (`""`) to create a root record (similar to using `@` in a DNS zone file).
- `record_type` (String) ❗ The record type (`A`, `AAAA`, `ALIAS`, `CAA`, `CNAME`, `HINFO`, `MX`, `NAPTR`, `NS`, `POOL`, `SPF`, `SRV`, `SSHFP`, `TXT`, `URL`).

### Optional

- `prio` (Number) The record priority (for types that support it; minimum `0`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `ttl` (Number) The record TTL (seconds; minimum `0`; default: `3600`).

### Read-Only

- `content_normalized` (String) The normalized value of the record
- `hostname` (String) The record *Fully Qualified Domain Name* (FQDN). Useful for aliasing `A`/`AAAA` records with `CNAME`.
- `id` (String) The ID of this resource.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing DNS domain record may be imported by `<domain-id>@<record-id>`:

terraform import \
  exoscale_domain_record.my_host \
  0a1ecf9d-99e7-40ea-83e7-1666017a2dd0@f81d4fae-7dec-11d0-a765-00a0c91e6bf6
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/

---

# exoscale_elastic_ip (Resource)

Manage Exoscale [Elastic IPs (EIP)](https://community.exoscale.com/product/networking/eip/index.md).

Corresponding data source: [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/data-sources/elastic_ip/index.md).

## Example Usage

*Unmanaged* EIPv4:

```terraform
resource "exoscale_elastic_ip" "my_elastic_ip" {
  zone = "ch-gva-2"
}
```

*Managed* EIPv6:

```terraform
resource "exoscale_elastic_ip" "my_managed_elastic_ip" {
  zone = "ch-gva-2"
  address_family = "inet6"
  reverse_dns = "example.net"

  healthcheck {
    mode         = "https"
    port         = 443
    uri          = "/health"
    interval     = 5
    timeout      = 3
    strikes_ok   = 2
    strikes_fail = 3
    tls_sni      = "example.net"
  }
}
```

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


## Schema

### Required

- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `address_family` (String) ❗ The Elastic IP (EIP) address family (`inet4` or `inet6`; default: `inet4`).
- `description` (String) A free-form text describing the Elastic IP (EIP).
- `healthcheck` (Block List, Max: 1) Healthcheck configuration for *managed* EIPs. It can not be added to an existing *Unmanaged* EIP. (see [below for nested schema](#nestedblock--healthcheck))
- `labels` (Map of String) A map of key/value labels.
- `reverse_dns` (String) Domain name for reverse DNS record.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `cidr` (String) The Elastic IP (EIP) CIDR.
- `id` (String) The ID of this resource.
- `ip_address` (String) The Elastic IP (EIP) IPv4 or IPv6 address.

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

Required:

- `mode` (String) The healthcheck mode (`tcp`, `http` or `https`; may only be set at creation time).
- `port` (Number) The healthcheck target port (must be between `1` and `65535`).

Optional:

- `interval` (Number) The healthcheck interval (seconds; must be between `5` and `300`; default: `10`).
- `strikes_fail` (Number) The number of failed healthcheck attempts before considering the target unhealthy (must be between `1` and `20`; default: `2`).
- `strikes_ok` (Number) The number of successful healthcheck attempts before considering the target healthy (must be between `1` and `20`; default: `3`).
- `timeout` (Number) The time before considering a healthcheck probing failed (seconds; must be between `2` and `60`; default: `3`).
- `tls_skip_verify` (Boolean) Disable TLS certificate verification for healthcheck in `https` mode (boolean; default: `false`).
- `tls_sni` (String) The healthcheck server name to present with SNI in `https` mode.
- `uri` (String) The healthcheck target URI (required in `http(s)` modes).


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

Optional:

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

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

## Import

An existing Elastic IP (EIP) may be imported by `<ID>@<zone>`:

```shell
terraform import \
  exoscale_elastic_ip.my_elastic_ip \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/iam_access_key/

---

# exoscale_iam_access_key (Resource)

Manage Exoscale [IAM Access Keys](https://community.exoscale.com/documentation/iam/)

!> **WARNING:** This resource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.

## Example Usage

```terraform
resource "exoscale_iam_access_key" "my_sos_access_key" {
  name       = "my-sos-access-key"
  operations = ["get-sos-object", "list-sos-bucket"]
  resources  = ["sos/bucket:my-bucket"]
}

resource "exoscale_iam_access_key" "my_sks_access_key" {
  name = "my-sks-access-key"
  tags = ["sks"]
}
```

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

-> **NOTE:** You can retrieve the list of available operations and tags using the [Exoscale CLI](https://github.com/exoscale/cli/): `exo iam access-key list-operations`.


## Schema

### Required

- `name` (String) ❗ The IAM access key name.

### Optional

- `operations` (Set of String) ❗ A list of API operations to restrict the key to.
- `resources` (Set of String) ❗ A list of API [resources](https://community.exoscale.com/documentation/iam/quick-start/#restricting-api-access-keys-to-resources) to restrict the key to (`<domain>/<type>:<name>`).
- `tags` (Set of String) ❗ A list of tags to restrict the key to.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `key` (String, Sensitive) The IAM access key (identifier).
- `secret` (String, Sensitive) The key secret.
- `tags_operations` (Set of String)

<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.

---

url: https://community.exoscale.com/reference/terraform/provider/resources/iam_api_key/

---

# exoscale_iam_api_key (Resource)

Manage Exoscale [IAM](https://community.exoscale.com/documentation/iam/) API Keys.

!> **WARNING:** This resource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.

## Example Usage

```terraform
resource "exoscale_iam_role" "my_role" {
  name = "my-role"
  description = "Example role"
  editable = true
  
  policy = {
    default_service_strategy = "deny"
    services = {
      sos = {
        type = "allow"
      }
    }
  }

}


resource "exoscale_iam_api_key" "my_api_key" {
  name = "my-api-key"
  role_id = exoscale_iam_role.my_role.id
}
```

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


## Schema

### Required

- `name` (String) ❗ IAM API Key name.
- `role_id` (String) ❗ IAM API role ID.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `key` (String) The IAM API Key to match.
- `secret` (String, Sensitive) Secret for the IAM API Key.

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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/iam_org_policy/

---

# exoscale_iam_org_policy (Resource)

Manage Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Org Policy.

-> IAM Organization Policy is persistent resource that can only be updated, thus terraform lifecycle is different: creation of resource updates the Org Policy and deleting resource only removes it from terraform state.

!> **WARNING** Org Policy applies to the whole organization including the account used by terraform.

## Example Usage

```terraform
resource "exoscale_iam_org_policy" "org_policy" {
  default_service_strategy = "allow"
  services = {
    sos = {
      type = "deny"
    }
  }
}
```

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


## Schema

### Required

- `default_service_strategy` (String) Default service strategy (`allow` or `deny`).
- `services` (Attributes Map) IAM policy services. (see [below for nested schema](#nestedatt--services))

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

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

<a id="nestedatt--services"></a>
### Nested Schema for `services`

Optional:

- `rules` (Attributes List) List of IAM service rules (if type is `rules`). (see [below for nested schema](#nestedatt--services--rules))
- `type` (String) Service type (`rules`, `allow`, or `deny`).

<a id="nestedatt--services--rules"></a>
### Nested Schema for `services.rules`

Optional:

- `action` (String) IAM policy rule action (`allow` or `deny`).
- `expression` (String) IAM policy rule expression.
- `resources` (List of String, Deprecated)



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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/iam_role/

---

# exoscale_iam_role (Resource)

Manage Exoscale [IAM](https://community.exoscale.com/documentation/iam/) Role.




## Schema

### Required

- `name` (String) ❗Name of IAM Role.

### Optional

- `description` (String) A free-form text describing the IAM Role
- `editable` (Boolean) Defines if IAM Role Policy is editable or not. Defaults to `true`. This attribute cannot be changed after creation.
- `labels` (Map of String) IAM Role labels.
- `permissions` (List of String) IAM Role permissions.
- `policy` (Attributes) IAM Policy. (see [below for nested schema](#nestedatt--policy))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

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

<a id="nestedatt--policy"></a>
### Nested Schema for `policy`

Optional:

- `default_service_strategy` (String) Default service strategy (`allow` or `deny`).
- `services` (Attributes Map) IAM policy services. (see [below for nested schema](#nestedatt--policy--services))

<a id="nestedatt--policy--services"></a>
### Nested Schema for `policy.services`

Optional:

- `rules` (Attributes List) List of IAM service rules (if type is `rules`). (see [below for nested schema](#nestedatt--policy--services--rules))
- `type` (String) Service type (`rules`, `allow`, or `deny`).

<a id="nestedatt--policy--services--rules"></a>
### Nested Schema for `policy.services.rules`

Optional:

- `action` (String) IAM policy rule action (`allow` or `deny`).
- `expression` (String) IAM policy rule expression.
- `resources` (List of String, Deprecated)




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

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/

---

# exoscale_instance_pool (Resource)

Manage Exoscale [Instance Pools](https://community.exoscale.com/product/compute/instances/how-to/instance-pools/index.md).

Corresponding data sources: [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool/index.md), [exoscale_instance_pool_list](https://community.exoscale.com/reference/terraform/provider/data-sources/instance_pool_list/index.md).

## Example Usage

```terraform
data "exoscale_template" "my_template" {
  zone = "ch-gva-2"
  name = "Linux Ubuntu 22.04 LTS 64-bit"
}

resource "exoscale_instance_pool" "my_instance_pool" {
  zone = "ch-gva-2"
  name = "my-instance-pool"

  template_id   = data.exoscale_template.my_template.id
  instance_type = "standard.medium"
  disk_size     = 10
  size          = 3
}
```

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


## Schema

### Required

- `name` (String) The instance pool name.
- `size` (Number) The number of managed instances.
- `template_id` (String) The [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md) (ID) to use when creating the managed instances.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `affinity_group_ids` (Set of String, Deprecated) A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs; may only be set at creation time).
- `anti_affinity_group_ids` (Set of String) A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs; may only be set at creation time).
- `deploy_target_id` (String) A deploy target ID.
- `description` (String) A free-form text describing the pool.
- `disk_size` (Number) The managed instances disk size (GiB).
- `elastic_ip_ids` (Set of String) A list of [exoscale_elastic_ip](https://community.exoscale.com/reference/terraform/provider/resources/elastic_ip/index.md) (IDs).
- `instance_prefix` (String) The string used to prefix managed instances name (default: `pool`).
- `instance_type` (String) The managed compute instances type (`<family>.<size>`, e.g. `standard.medium`; use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo compute instance-type list` - for the list of available types).
- `instances` (Block Set) The list of managed instances. Structure is documented below. (see [below for nested schema](#nestedblock--instances))
- `ipv6` (Boolean) Enable IPv6 on managed instances (boolean; default: `false`).
- `key_pair` (String) The [exoscale_ssh_key](https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/index.md) (name) to authorize in the managed instances.
- `labels` (Map of String) A map of key/value labels.
- `min_available` (Number) Minimum number of running Instances.
- `network_ids` (Set of String) A list of [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs).
- `security_group_ids` (Set of String) A list of [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) (IDs).
- `service_offering` (String, Deprecated) The managed instances type. Please use the `instance_type` argument instead.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `user_data` (String) [cloud-init](http://cloudinit.readthedocs.io/) configuration to apply to the managed instances.
- `virtual_machines` (Set of String, Deprecated) The list of managed instances (IDs). Please use the `instances.*.id` attribute instead.

### Read-Only

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

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

Optional:

- `name` (String) The instance name.

Read-Only:

- `id` (String) The ID of this resource.
- `ipv6_address` (String) The instance (main network interface) IPv6 address.
- `public_ip_address` (String) The instance (main network interface) IPv4 address.


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

Optional:

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

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

## Import

```shell
# An existing instance pool may be imported by `<ID>@<zone>`:

terraform import \
  exoscale_instance_pool.my_instance_pool \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/kms_key/

---

# exoscale_kms_key (Resource)

Manage Exoscale KMS Keys.




## Schema

### Required

- `name` (String) ❗ The name of the KMS Key.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) ❗ A description of the KMS Key.
- `multi_zone` (Boolean) ❗ Whether the key is replicated across multiple zones.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `usage` (String) ❗ The key usage purpose (e.g. `encrypt-decrypt`).

### Read-Only

- `id` (String) The ID of this resource.
- `status` (String) The current status of the KMS Key.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/nlb/

---

# exoscale_nlb (Resource)

Manage Exoscale [Network Load Balancers (NLB)](https://community.exoscale.com/product/networking/nlb/index.md).

Corresponding data source: [exoscale_nlb](https://community.exoscale.com/reference/terraform/provider/data-sources/nlb/index.md).

## Example Usage

```terraform
resource "exoscale_nlb" "my_nlb" {
  zone = "ch-gva-2"
  name = "my-nlb"
}
```

Next step is to attach [exoscale_nlb_service](https://community.exoscale.com/reference/terraform/provider/resources/nlb_service/index.md)(s) to the NLB.

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


## Schema

### Required

- `name` (String) The network load balancer (NLB) name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `address_family` (String) ❗ The NLB address family (`inet4`|`inet6`; default: `inet4`).
- `description` (String) A free-form text describing the NLB.
- `labels` (Map of String) A map of key/value labels.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `created_at` (String) The NLB creation date.
- `id` (String) The ID of this resource.
- `ip_address` (String) The NLB public IP address (IPv4 or IPv6, depending on `address_family`).
- `services` (Set of String) The list of the [exoscale_nlb_service](https://community.exoscale.com/reference/terraform/provider/resources/nlb_service/index.md) (IDs).
- `state` (String) The current NLB state.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing network load balancer (NLB) may be imported by `<ID>@<zone>`:

```console
terraform import \
  exoscale_nlb.my_nlb \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

~> **NOTE:** Importing an `exoscale_nlb` resource does _not_ import related `exoscale_nlb_service` resources.

---

url: https://community.exoscale.com/reference/terraform/provider/resources/nlb_service/

---

# exoscale_nlb_service (Resource)

Manage Exoscale [Network Load Balancer (NLB)](https://community.exoscale.com/product/networking/nlb/index.md) Services.

Corresponding data source: [exoscale_nlb_service_list](https://community.exoscale.com/reference/terraform/provider/data-sources/nlb_service_list/index.md).

## Example Usage

```terraform
resource "exoscale_nlb" "my_nlb" {
  zone = "ch-gva-2"
  name = "my-nlb"
}

resource "exoscale_nlb_service" "my_nlb_service" {
  nlb_id = exoscale_nlb.my_nlb.id
  zone   = exoscale_nlb.my_nlb.zone
  name   = "my-nlb-service"

  instance_pool_id = exoscale_instance_pool.my_instance_pool.id
  protocol         = "tcp"
  port             = 443
  target_port      = 8443
  strategy         = "round-robin"

  healthcheck {
    mode     = "https"
    port     = 8443
    uri      = "/healthz"
    tls_sni  = "example.net"
    interval = 5
    timeout  = 3
    retries  = 1
  }
}
```

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


## Schema

### Required

- `instance_pool_id` (String) ❗ The [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md) (ID) to forward traffic to.
- `name` (String) The NLB service name.
- `nlb_id` (String) ❗ The parent [exoscale_nlb](https://community.exoscale.com/reference/terraform/provider/resources/nlb/index.md) ID.
- `port` (Number) The NLB service (TCP/UDP) port.
- `target_port` (Number) The (TCP/UDP) port to forward traffic to (on target instance pool members).
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) A free-form text describing the NLB service.
- `healthcheck` (Block Set) The service health checking configuration. (see [below for nested schema](#nestedblock--healthcheck))
- `protocol` (String) The protocol (`tcp`|`udp`; default: `tcp`).
- `strategy` (String) The strategy (`round-robin`|`source-hash`; default: `round-robin`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `state` (String) The current NLB service state.

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

Required:

- `port` (Number) The healthcheck port.

Optional:

- `interval` (Number) The healthcheck interval in seconds (default: `10`).
- `mode` (String) The healthcheck mode (`tcp`|`http`|`https`; default: `tcp`).
- `retries` (Number) The healthcheck retries (default: `1`).
- `timeout` (Number) The healthcheck timeout (seconds; default: `5`).
- `tls_sni` (String) The healthcheck TLS SNI server name (only if `mode` is `https`).
- `uri` (String) The healthcheck URI (must be set only if `mode` is `http(s)`).


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing NLB service may be imported by `<nlb-ID>/<service-ID>@<zone>`:

terraform import \
  exoscale_nlb_service.my_nlb_service \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6/9ecc6b8b-73d4-4211-8ced-f7f29bb79524@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/private_network/

---

# exoscale_private_network (Resource)

Manage Exoscale [Private Networks](https://community.exoscale.com/product/networking/private-network/index.md).

Corresponding data source: [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/data-sources/private_network/index.md).

## Example Usage

*Unmanaged* private network:

```terraform
resource "exoscale_private_network" "my_private_network" {
  zone = "ch-gva-2"
  name = "my-private-network"
}
```

*Managed* private network:

```terraform
resource "exoscale_private_network" "my_managed_private_network" {
  zone = "ch-gva-2"
  name = "my-managed-private-network"

  netmask  = "255.255.255.0"
  start_ip = "10.0.0.20"
  end_ip   = "10.0.0.253"
}
```

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


## Schema

### Required

- `name` (String) The private network name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) A free-form text describing the network.
- `end_ip` (String) (For managed Privnets) The first/last IPv4 addresses used by the DHCP service for dynamic leases.
- `labels` (Map of String) A map of key/value labels.
- `netmask` (String) (For managed Privnets) The network mask defining the IPv4 network allowed for static leases.
- `start_ip` (String) (For managed Privnets) The first/last IPv4 addresses used by the DHCP service for dynamic leases.
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing private network may be imported by `<ID>@<zone>`:

```shell
terraform import \
  exoscale_private_network.my_private_network \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/security_group/

---

# exoscale_security_group (Resource)

Manage Exoscale [Security Groups](https://community.exoscale.com/product/networking/security-group/index.md).

Corresponding data source: [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/data-sources/security_group/index.md).

## Example Usage

```terraform
resource "exoscale_security_group" "my_security_group" {
  name = "my-security-group"
}
```

Next step is to attach [exoscale_security_group_rule](https://community.exoscale.com/reference/terraform/provider/resources/security_group_rule/index.md)(s) to the group.

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


## Schema

### Required

- `name` (String) ❗ The name of the Security Group.

### Optional

- `description` (String) ❗ A free-form text describing the the Security Group.
- `external_sources` (Set of String) A list of external network sources, in [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation) notation.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of the Security Group.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing security group may be imported by `<ID>`:

```shell
terraform import \
  exoscale_security_group.my_security_group \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/security_group_rule/

---

# exoscale_security_group_rule (Resource)

Manage [Exoscale Security Groups](https://community.exoscale.com/product/compute/instances/quick-start/index.md#firewall-rules---security-groups) rules.

Parent resource: [exoscale_security_group_rule](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md).

## Example Usage

```terraform
resource "exoscale_security_group" "my_security_group" {
  name = "my-security-group"
}

resource "exoscale_security_group_rule" "my_security_group_rule" {
  security_group_id = exoscale_security_group.my_security_group.id
  type              = "INGRESS"
  protocol          = "TCP"
  cidr              = "0.0.0.0/0" # "::/0" for IPv6
  start_port        = 80
  end_port          = 80
}
```

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


## Schema

### Required

- `security_group_id` (String) ❗ The parent [exoscale_security_group](https://community.exoscale.com/reference/terraform/provider/resources/security_group/index.md) ID.
- `type` (String) ❗ The traffic direction to match (`INGRESS` or `EGRESS`).

### Optional

- `cidr` (String) ❗ An (`INGRESS`) source / (`EGRESS`) destination IP subnet (in [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)) to match (conflicts with `public_security_group`/`user_security_group_id`).
- `description` (String) ❗ A free-form text describing the the Security Group rule.
- `end_port` (Number) ❗The end port number in the `TCP`/`UDP` port range to match (conflicts with `icmp_type`/`icmp_code`).
- `icmp_code` (Number) ❗An ICMP/ICMPv6 [code](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages) to match.
- `icmp_type` (Number) ❗An ICMP/ICMPv6 [type](https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages) to match.
- `protocol` (String) ❗ The network protocol to match (`TCP`, `UDP`, `ICMP`, `ICMPv6`, `AH`, `ESP`, `GRE` or `IPIP`)
- `public_security_group` (String) ❗ An (`INGRESS`) source / (`EGRESS`) destination public security group name to match (conflicts with `cidr`/`user_security_group_id`).
- `start_port` (Number) ❗A start port number in the `TCP`/`UDP` port range to match (conflicts with `icmp_type`/`icmp_code`).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `user_security_group_id` (String) ❗ An (`INGRESS`) source / (`EGRESS`) user security group ID to match (conflicts with `cidr`/`public_security_group`).

### Read-Only

- `id` (String) The ID of the Security Group rule.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing security group rule may be imported by `<security-group-ID>@<security-group-rule-ID>`:

terraform import \
  exoscale_security_group_rule.my_security_group_rule \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@9ecc6b8b-73d4-4211-8ced-f7f29bb79524
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/

---

# exoscale_sks_cluster (Resource)

Manage Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Clusters.

Corresponding data source: [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/data-sources/sks_cluster/index.md).

## Example Usage

```terraform
resource "exoscale_sks_cluster" "my_sks_cluster" {
  zone = "ch-gva-2"
  name = "my-sks-cluster"
}

output "my_sks_cluster_endpoint" {
  value = exoscale_sks_cluster.my_sks_cluster.endpoint
}
```

Next step is to attach [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/resources/sks_nodepool/index.md)(s) to the cluster.

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


## Schema

### Required

- `name` (String) The SKS cluster name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `audit` (Block List) Parameters for Kubernetes Audit configuration (may only be enabled at creation time) (see [below for nested schema](#nestedblock--audit))
- `auto_upgrade` (Boolean) Enable automatic upgrading of the control plane version.
- `cni` (String) The CNI plugin that is to be used. Available options are "calico" or "cilium". Defaults to "calico". Setting empty string will result in a cluster with no CNI.
- `create_default_security_group` (Boolean) ❗ Creates an ad-hoc security group based on the choice of the selected CNI (may only be set at creation time).
- `description` (String) A free-form text describing the cluster.
- `enable_karpenter` (Boolean) Indicates whether to deploy Karpenter for cluster autoscaling.
- `enable_kube_proxy` (Boolean) ❗ Indicates whether to deploy the Kubernetes network proxy. (may only be set at creation time)
- `exoscale_ccm` (Boolean) Deploy the Exoscale [Cloud Controller Manager](https://github.com/exoscale/exoscale-cloud-controller-manager/) in the control plane (boolean; default: `true`; may only be set at creation time).
- `exoscale_csi` (Boolean) Deploy the Exoscale [Container Storage Interface](https://github.com/exoscale/exoscale-csi-driver/) on worker nodes (boolean; default: `false`; requires the CCM to be enabled).
- `feature_gates` (Set of String) Feature gates options for the cluster.
- `karpenter_feature_gates` (Set of String) A list of Karpenter controller feature gates to enable for the Karpenter controller binary.
- `labels` (Map of String) A map of key/value labels.
- `metrics_server` (Boolean) Deploy the [Kubernetes Metrics Server](https://github.com/kubernetes-sigs/metrics-server/) in the control plane (boolean; default: `true`; may only be set at creation time).
- `oidc` (Block List) An OpenID Connect configuration to provide to the Kubernetes API server (may only be set at creation time). Structure is documented below. (see [below for nested schema](#nestedblock--oidc))
- `service_level` (String) The service level of the control plane (`pro` or `starter`; default: `pro`; may only be set at creation time).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `version` (String) The version of the control plane (default: latest version available from the API; see `exo compute sks versions` for reference; may only be set at creation time).

### Read-Only

- `aggregation_ca` (String, Sensitive) The CA certificate (in PEM format) for TLS communications between the control plane and the aggregation layer (e.g. `metrics-server`).
- `control_plane_ca` (String, Sensitive) The CA certificate (in PEM format) for TLS communications between control plane components.
- `created_at` (String) The cluster creation date.
- `default_security_group_id` (String) The ID of the cluster's ad-hoc default security group (when `create_default_security_group` was set at creation time).
- `endpoint` (String) The cluster API endpoint.
- `id` (String) The SKS cluster ID.
- `kubelet_ca` (String, Sensitive) The CA certificate (in PEM format) for TLS communications between kubelets and the control plane.
- `nodepools` (Set of String) The list of [exoscale_sks_nodepool](https://community.exoscale.com/reference/terraform/provider/resources/sks_nodepool/index.md) (IDs) attached to the cluster.
- `state` (String) The cluster state.

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

Optional:

- `bearer_token` (String, Sensitive) The optional bearer token to include in the request header
- `enabled` (Boolean) Whether to run the APIServer with the configured Kubernetes Audit
- `endpoint` (String) The Endpoint URL for the Webserver responsible of processing Audit events
- `initial_backoff` (String) The Initial Backoff to wait before sending data to the remote server (default `10s`)


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

Required:

- `client_id` (String) The OpenID client ID.
- `issuer_url` (String) The OpenID provider URL.

Optional:

- `groups_claim` (String) An OpenID JWT claim to use as the user's group.
- `groups_prefix` (String) An OpenID prefix prepended to group claims.
- `required_claim` (Map of String) A map of key/value pairs that describes a required claim in the OpenID Token.
- `username_claim` (String) An OpenID JWT claim to use as the user name.
- `username_prefix` (String) An OpenID prefix prepended to username claims.


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing SKS cluster may be imported by `<ID>@<zone>`:

```shell
terraform import \
  exoscale_sks_cluster.my_sks_cluster \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

~> **NOTE:** Importing an `exoscale_sks_cluster` resource does _not_ import related `exoscale_sks_nodepool` resources.

---

url: https://community.exoscale.com/reference/terraform/provider/resources/sks_kubeconfig/

---

# exoscale_sks_kubeconfig (Resource)

Manage Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Credentials (*Kubeconfig*).

!> **WARNING:** This resource stores sensitive information in your Terraform state. Please be sure to correctly understand implications and how to mitigate potential risks before using it.

## Example Usage

```terraform
resource "exoscale_sks_cluster" "my_sks_cluster" {
  zone = "ch-gva-2"
  name = "my-sks-cluster"
}

resource "exoscale_sks_kubeconfig" "my_sks_kubeconfig" {
  cluster_id = exoscale_sks_cluster.my_sks_cluster.id
  zone       = exoscale_sks_cluster.my_sks_cluster.zone

  user   = "kubernetes-admin"
  groups = ["system:masters"]
}
```

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


## Schema

### Required

- `cluster_id` (String) ❗ The parent [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/index.md) ID.
- `groups` (Set of String) ❗ Group names in the generated Kubeconfig. The certificate present in the Kubeconfig will have these roles set in the Organization field.
- `user` (String) ❗ User name in the generated Kubeconfig. The certificate present in the Kubeconfig will also have this name set for the CN field.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `early_renewal_seconds` (Number) If set, the resource will consider the Kubeconfig to have expired the given number of seconds before its actual CA certificate or client certificate expiry time. This can be useful to deploy an updated Kubeconfig in advance of the expiration of its internal current certificate. Note however that the old certificate remains valid until its true expiration time since this resource does not (and cannot) support revocation. Also note this advance update can only take place if the Terraform configuration is applied during the early renewal period (seconds; default: 0).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `ttl_seconds` (Number) ❗ The Time-to-Live of the Kubeconfig, after which it will expire / become invalid (seconds; default: 2592000 = 30 days).

### Read-Only

- `id` (String) The ID of this resource.
- `kubeconfig` (String, Sensitive) The generated Kubeconfig (YAML content).
- `ready_for_renewal` (Boolean)

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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



## Automatic Renewal

This resource considers its instances to have been deleted after either their validity period ends or the early renewal period is reached. Past this period, applying the Terraform configuration will cause a new Kubeconfig to be generated.

Therefore in a development environment with frequent deployments, it may be convenient to set a relatively-short expiration time and use early renewal to automatically provision a new Kubeconfig when the current one is about to expire.

The creation of a new Kubeconfig may of course cause dependent resources to be updated or replaced, depending on the lifecycle rules applying to those resources.

---

url: https://community.exoscale.com/reference/terraform/provider/resources/sks_nodepool/

---

# exoscale_sks_nodepool (Resource)

Manage Exoscale [Scalable Kubernetes Service (SKS)](https://community.exoscale.com/product/compute/containers/index.md) Node Pools.

## Example Usage

```terraform
resource "exoscale_sks_cluster" "my_sks_cluster" {
  zone = "ch-gva-2"
  name = "my-sks-cluster"
}

resource "exoscale_sks_nodepool" "my_sks_nodepool" {
  cluster_id         = exoscale_sks_cluster.my_sks_cluster.id
  zone               = exoscale_sks_cluster.my_sks_cluster.zone
  name               = "my-sks-nodepool"

  instance_type      = "standard.medium"
  size               = 3
}
```

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


## Schema

### Required

- `cluster_id` (String) ❗ The parent [exoscale_sks_cluster](https://community.exoscale.com/reference/terraform/provider/resources/sks_cluster/index.md) ID.
- `instance_type` (String) The managed compute instances type (`<family>.<size>`, e.g. `standard.medium`; use the [Exoscale CLI](https://github.com/exoscale/cli/) - `exo compute instance-type list` - for the list of available types).
- `name` (String) The SKS node pool name.
- `size` (Number)
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `anti_affinity_group_ids` (Set of String) A list of [exoscale_anti_affinity_group](https://community.exoscale.com/reference/terraform/provider/resources/anti_affinity_group/index.md) (IDs) to be attached to the managed instances.
- `deploy_target_id` (String) A deploy target ID.
- `description` (String) A free-form text describing the pool.
- `disk_size` (Number) The managed instances disk size (GiB; default: `50`).
- `instance_prefix` (String) The string used to prefix the managed instances name (default `pool`).
- `ipv6` (Boolean) Enable IPV6 for the nodepool nodes
- `kubelet_image_gc` (Attributes) Configuration for this nodepool's kubelet image garbage collector. (see [below for nested schema](#nestedatt--kubelet_image_gc))
- `kubelet_max_pods` (Number) The maximum number of pods per node (default is 110).
- `labels` (Map of String) A map of key/value labels.
- `nvidia_mig_profile` (String) The NVIDIA [Multi-Instance GPU (MIG)](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/) profile to enable on the managed GPUs. The GPU family is inferred from `instance_type`: `gpua30.*` accepts `2g.12gb`, `1g.6gb+me`, `1g.6gb`, `2g.12gb+me`, `4g.24gb`; `gpurtx6000pro.*` accepts `1g.24gb-me`, `1g.24gb`, `2g.48gb-me`, `2g.48gb`, `4g.96gb+gfx`, `1g.24gb+me`, `2g.48gb+me.all`, `1g.24gb+gfx`, `1g.24gb+me.all`, `4g.96gb`, `2g.48gb+gfx`.
- `private_network_ids` (Set of String) A list of [exoscale_private_network](https://community.exoscale.com/reference/terraform/provider/resources/private_network/index.md) (IDs) to be attached to the managed instances.
- `security_group_ids` (Set of String) A list of exoscale_security_group (IDs) to be attached to the managed instances.
- `storage_lvm` (Boolean) Create nodes with non-standard partitioning for persistent storage (requires min 100G of disk space) (may only be set at creation time).
- `taints` (Map of String) A map of key/value Kubernetes [taints](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) ('taints = { <key> = "<value>:<effect>" }').
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `created_at` (String) The pool creation date.
- `id` (String) The SKS node pool ID.
- `instance_pool_id` (String) The underlying [exoscale_instance_pool](https://community.exoscale.com/reference/terraform/provider/resources/instance_pool/index.md) ID.
- `state` (String) The current pool state.
- `template_id` (String) The managed instances template ID.
- `version` (String) The managed instances version.

<a id="nestedatt--kubelet_image_gc"></a>
### Nested Schema for `kubelet_image_gc`

Optional:

- `high_threshold` (Number) The percent of disk usage after which image garbage collection is always run
- `low_threshold` (Number) The percent of disk usage before which image garbage collection is never run
- `min_age` (String) The minimum age for an unused image before it is garbage collected (k8s duration format, eg. 1h)


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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

An existing SKS node pool may be imported by `<cluster-ID>/<nodepool-ID>@<zone>`:

```shell
terraform import \
  exoscale_sks_nodepool.my_sks_nodepool \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6/9ecc6b8b-73d4-4211-8ced-f7f29bb79524@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/sos_bucket_policy/

---

# exoscale_sos_bucket_policy (Resource)

Manage Exoscale [SOS Bucket Policies](https://community.exoscale.com/product/storage/object-storage/how-to/bucketpolicy/index.md).




## Schema

### Required

- `bucket` (String) ❗ The name of the bucket to which the policy is to be applied.
- `policy` (String) The content of the policy
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

---

url: https://community.exoscale.com/reference/terraform/provider/resources/ssh_key/

---

# exoscale_ssh_key (Resource)

Manage Exoscale [SSH Keys](https://community.exoscale.com/product/compute/instances/how-to/ssh-keypairs/index.md).

## Example Usage

```terraform
resource "exoscale_ssh_key" "my_ssh_key" {
  name       = "my-ssh-key"
  public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGRY..."
}
```

Should you want to _create_ an SSH keypair (including *private* key) with Terraform, please use the
[tls_private_key](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key)
resource:

```terraform
resource "tls_private_key" "my_ssh_key" {
  algorithm = "ED25519"
}

resource "exoscale_ssh_key" "my_ssh_key" {
  name       = "my-ssh-key"
  public_key = tls_private_key.my_ssh_key.public_key_openssh
}
```

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


## Schema

### Required

- `name` (String) ❗ The SSH key name.
- `public_key` (String) ❗ The SSH *public* key that will be authorized in compute instances.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `fingerprint` (String) The SSH key unique identifier.
- `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

An existing SSH key may be imported as a resource by `<name>`:

```shell
terraform import \
  exoscale_ssh_key.my_ssh_key \
  my-ssh-key
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/template/

---

# exoscale_template (Resource)

Manage Exoscale [Compute Instance Custom Templates](https://community.exoscale.com/product/compute/instances/how-to/custom-templates/index.md).

Registering a custom template that can be used as the initial setup of a Compute instance.

Corresponding data source: [exoscale_template](https://community.exoscale.com/reference/terraform/provider/data-sources/template/index.md).

## Example Usage

```terraform
resource "exoscale_template" "my_template" {
  zone             = "ch-gva-2"
  name             = "my-custom-template"
  description      = "My custom template"
  url              = "https://example.com/my-image.qcow2"
  checksum         = "8a4c47..."
  default_user     = "root"
  boot_mode        = "uefi"
  password_enabled = false
  ssh_key_enabled  = true
}
```

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


## Schema

### Required

- `checksum` (String) ❗ The MD5 checksum of the template image referenced by `url`.
- `name` (String) The template name.
- `password_enabled` (Boolean) ❗ Whether to enable password-based login on Compute instances based on this template.
- `ssh_key_enabled` (Boolean) ❗ Whether to enable SSH key-based login on Compute instances based on this template.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `application_consistent_snapshot_enabled` (Boolean) ❗ Whether the template supports application-consistent snapshots (requires the QEMU guest agent to be installed).
- `boot_mode` (String) ❗ The template boot mode: `legacy` (default) or `uefi`.
- `build` (String) ❗ The template build.
- `default_user` (String) ❗ Username used to log into a Compute instance based on this template.
- `description` (String) A free-form text describing the template.
- `maintainer` (String) ❗ The template maintainer.
- `size` (Number) ❗ The template size in GB. Defaults to the size of the downloaded image.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `url` (String) ❗ The URL to download the template image (qcow2/raw disk image) from. Required when registering a new template. The API only uses this once and never returns it afterwards, so on `terraform import` it is left unset — omit it from your configuration after importing to avoid a one-time forced replacement.
- `version` (String) ❗ The template version.

### Read-Only

- `created_at` (String) The template creation date.
- `family` (String) The template family.
- `id` (String) The ID of this resource.
- `visibility` (String) The template visibility (custom templates are always `private`).

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
terraform import \
  exoscale_template.my_template \
  eb556678-abcd-1234-8f2b-becbd8b1cac1@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/vpc/

---

# exoscale_vpc (Resource)

Manage Exoscale Virtual Private Clouds (VPC).

Corresponding data source: [exoscale_vpc](https://community.exoscale.com/reference/terraform/provider/data-sources/vpc/index.md).

## Example Usage

```terraform
locals {
  zone = "ch-gva-2"
}

resource "exoscale_vpc" "my_vpc" {
  zone        = local.zone
  name        = "my-vpc"
  description = "My Virtual Private Cloud"

  labels = {
    environment = "production"
  }
}
```

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


## Schema

### Required

- `name` (String) The VPC name.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) A text describing the VPC.
- `dns_servers` (List of String) DHCP option 6: a list of DNS server IPv4 addresses.
- `domain_search` (List of String) DHCP option 119: a list of domain search strings.
- `labels` (Map of String) A map of key/value labels.
- `ntp_servers` (List of String) DHCP option 42: a list of NTP server IPv4 addresses.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `default` (Boolean) Whether this is the organization's default VPC for the zone.
- `id` (String) The ID of this resource.

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

Optional:

- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing VPC may be imported by `<ID>@<zone>`:

terraform import \
  exoscale_vpc.my_vpc \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/vpc_route/

---

# exoscale_vpc_route (Resource)

Manage Exoscale [VPC Subnet routes](https://community.exoscale.com/product/networking/vpc/how-to/using-routing-rules/index.md).

Routes are immutable: any change to their attributes forces re-creation.

Parent resource: [exoscale_vpc_subnet](https://community.exoscale.com/reference/terraform/provider/resources/vpc_subnet/index.md).

## Example Usage

```terraform
locals {
  zone = "ch-gva-2"
}

resource "exoscale_vpc_route" "my_vpc_route" {
  zone        = local.zone
  vpc_id      = "f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
  subnet_id   = "9ecc6b8b-73d4-4211-8ced-f7f29bb79524"
  destination = "10.0.9.0/24"
  target      = "ip=10.0.0.5"
  description = "route to 10.0.9.0/24 via 10.0.0.5"
}
```

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


## Schema

### Required

- `destination` (String) ❗ The route destination CIDR (e.g. `10.9.0.0/24`).
- `subnet_id` (String) ❗ The parent [exoscale_vpc_subnet](https://community.exoscale.com/reference/terraform/provider/resources/vpc_subnet/index.md) ID.
- `target` (String) ❗ The route target (e.g. `ip=10.0.0.5`).
- `vpc_id` (String) ❗ The parent [exoscale_vpc](https://community.exoscale.com/reference/terraform/provider/resources/vpc/index.md) ID.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `description` (String) ❗ A free-form text describing the route.
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing VPC route may be imported by `<vpc-ID>@<subnet-ID>@<route-ID>@<zone>`:

terraform import \
  exoscale_vpc_route.my_vpc_route \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@9ecc6b8b-73d4-4211-8ced-f7f29bb79524@9ecc6b8b-73d4-4211-8ced-f7f29bb79525@ch-gva-2
```

---

url: https://community.exoscale.com/reference/terraform/provider/resources/vpc_subnet/

---

# exoscale_vpc_subnet (Resource)

Manage Exoscale [VPC](https://community.exoscale.ch/product/networking/vpc/) Subnets.

Corresponding data source: [exoscale\_vpc\_subnet](https://community.exoscale.com/reference/terraform/provider/data-sources/vpc_subnet/index.md).

## Example Usage

```terraform
locals {
  zone = "ch-gva-2"
}

resource "exoscale_vpc_subnet" "my_vpc_subnet" {
  zone        = local.zone
  vpc_id      = "9ecc6b8b-73d4-4211-8ced-f7f29bb79524"
  name        = "my-vpc-subnet"
  description = "My VPC Subnet"
  ipv4_block  = "10.0.0.0/24"

  labels = {
    environment = "production"
  }
}
```

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


## Schema

### Required

- `ipv4_block` (String) ❗ The Subnet IPv4 CIDR (e.g. `10.0.0.0/24`).
- `name` (String) The Subnet name.
- `vpc_id` (String) ❗ The parent [exoscale_vpc](https://community.exoscale.com/reference/terraform/provider/resources/vpc/index.md) ID.
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

- `address_family` (String) ❗ The Subnet address family. Currently only `inet4` is supported.
- `address_space` (String) ❗ The Subnet address space. Currently only `private` is supported.
- `description` (String) A free-form text describing the Subnet.
- `labels` (Map of String) A map of key/value labels.
- `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) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.
- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

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

## Import

```shell
# An existing VPC Subnet may be imported by `<vpc-ID>@<subnet-ID>@<zone>`:

terraform import \
  exoscale_vpc_subnet.my_vpc_subnet \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6@9ecc6b8b-73d4-4211-8ced-f7f29bb79524@ch-gva-2
```
