# 

# exoscale_dbaas (Resource)

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



<!-- schema generated by tfplugindocs -->
## 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 (`kafka`, `mysql`, `opensearch`, `pg`, `valkey`, `grafana`).
- `zone` (String) ❗ The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

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

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



