|
| 1 | +--- |
| 2 | +subcategory: "Databases" |
| 3 | +page_title: "Scaleway: scaleway_documentdb_instance" |
| 4 | +--- |
| 5 | + |
| 6 | +# scaleway_documentdb_instance |
| 7 | + |
| 8 | +Creates and manages Scaleway Database Instances. |
| 9 | +For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/). |
| 10 | + |
| 11 | +## Examples |
| 12 | + |
| 13 | +### Example Basic |
| 14 | + |
| 15 | +```hcl |
| 16 | +resource "scaleway_documentdb_instance" "main" { |
| 17 | + name = "test-documentdb-instance-basic" |
| 18 | + node_type = "docdb-play2-pico" |
| 19 | + engine = "FerretDB-1" |
| 20 | + user_name = "my_initial_user" |
| 21 | + password = "thiZ_is_v&ry_s3cret" |
| 22 | + tags = ["terraform-test", "scaleway_documentdb_instance", "minimal"] |
| 23 | + volume_size_in_gb = 20 |
| 24 | +} |
| 25 | +``` |
| 26 | + |
| 27 | +## Arguments Reference |
| 28 | + |
| 29 | +The following arguments are supported: |
| 30 | + |
| 31 | +- `node_type` - (Required) The type of database instance you want to create (e.g. `docdb-play2-pico`). |
| 32 | + |
| 33 | +~> **Important:** Updates to `node_type` will upgrade the Database Instance to the desired `node_type` without any |
| 34 | +interruption. Keep in mind that you cannot downgrade a Database Instance. |
| 35 | + |
| 36 | +- `engine` - (Required) Database Instance's engine version (e.g. `FerretDB-1`). |
| 37 | + |
| 38 | +~> **Important:** Updates to `engine` will recreate the Database Instance. |
| 39 | + |
| 40 | +- `volume_type` - (Optional, default to `lssd`) Type of volume where data are stored (`bssd` or `lssd`). |
| 41 | + |
| 42 | +- `volume_size_in_gb` - (Optional) Volume size (in GB) when `volume_type` is set to `bssd`. |
| 43 | + |
| 44 | +- `user_name` - (Optional) Identifier for the first user of the database instance. |
| 45 | + |
| 46 | +~> **Important:** Updates to `user_name` will recreate the Database Instance. |
| 47 | + |
| 48 | +- `password` - (Optional) Password for the first user of the database instance. |
| 49 | + |
| 50 | +- `is_ha_cluster` - (Optional) Enable or disable high availability for the database instance. |
| 51 | + |
| 52 | +- `telemetry_enabled` - (Optional) Enable telemetry to collects basic anonymous usage data and sends them to FerretDB telemetry service. More about the telemetry [here](https://docs.ferretdb.io/telemetry/#configure-telemetry). |
| 53 | + |
| 54 | +~> **Important:** Updates to `is_ha_cluster` will recreate the Database Instance. |
| 55 | + |
| 56 | +- `name` - (Optional) The name of the Database Instance. |
| 57 | + |
| 58 | +- `tags` - (Optional) The tags associated with the Database Instance. |
| 59 | + |
| 60 | +- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) |
| 61 | + in which the Database Instance should be created. |
| 62 | + |
| 63 | +- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the Database |
| 64 | + Instance is associated with. |
| 65 | + |
| 66 | +## Attributes Reference |
| 67 | + |
| 68 | +In addition to all arguments above, the following attributes are exported: |
| 69 | + |
| 70 | +- `id` - The ID of the Database Instance. |
| 71 | + |
| 72 | +~> **Important:** Database instances' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they |
| 73 | +are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111` |
| 74 | + |
| 75 | +- `organization_id` - The organization ID the Database Instance is associated with. |
| 76 | + |
| 77 | +## Import |
| 78 | + |
| 79 | +Database Instance can be imported using the `{region}/{id}`, e.g. |
| 80 | + |
| 81 | +```bash |
| 82 | +$ terraform import scaleway_documentdb_instance.db fr-par/11111111-1111-1111-1111-111111111111 |
| 83 | +``` |
0 commit comments