Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f51c9b4
feat(document_db): add instance resource
Codelax Aug 25, 2023
24aa566
lint
Codelax Aug 28, 2023
0ce0aa5
feat(document_db): add database resource
Codelax Aug 29, 2023
f7e0f3c
feat(documentdb): resources documentdb
Monitob Sep 19, 2023
15604c3
feat(documentdb): replica resource
Monitob Sep 20, 2023
8eb3b17
chore: add DocumentDB to CI test
Monitob Sep 20, 2023
25474bc
chore: test cassettes
Monitob Sep 21, 2023
8e3651a
chore: test cassettes
Monitob Sep 25, 2023
4459328
fix(documentdb): fix test
Monitob Sep 25, 2023
93333e0
docs(documentdb): add documentation resources
Monitob Sep 26, 2023
5bc4c4b
feat(documentdb): add resources private network and datasource load b…
Monitob Sep 26, 2023
f342e32
fix(documentdb): remve unused helpers
Monitob Sep 26, 2023
6202914
fix(documentdb): test resource naming
Monitob Sep 26, 2023
d113a38
feat(documentdb): add privilege basic cassette
Monitob Sep 26, 2023
ffac1ba
feat(documentdb): add missing cassettes
Monitob Sep 27, 2023
b8f06ce
docs: update documentdb documentation
Monitob Oct 2, 2023
af6cd72
fix(documentdb): rename telemetry variable
Monitob Oct 2, 2023
840fbed
docs: update documentation link
Monitob Oct 2, 2023
a25f4be
fix(documentdb): renambe file test
Monitob Oct 3, 2023
4c94757
chore: add cassettes files
Monitob Oct 3, 2023
e118efd
fix(documentdb): update test
Monitob Oct 3, 2023
926821a
fix(documentdb): update test
Monitob Oct 3, 2023
9dda473
fix(documentdb): update test
Monitob Oct 4, 2023
b20f98c
fix(documentdb): linter issue on set const
Monitob Oct 4, 2023
0f4d1b2
Merge branch 'master' into feat/document_db
Monitob Oct 4, 2023
7a0771c
fix(documentdb): remove telemetry option
Monitob Oct 4, 2023
a5d6477
fix(documentdb): revert telemetry setter
Monitob Oct 4, 2023
200dd82
fix(documentdb): remove telemetry enabled
Monitob Oct 4, 2023
4940fe4
Merge branch 'master' into feat/document_db
Monitob Oct 4, 2023
08c2f14
fix(documentdb): remove optional parameter on test
Monitob Oct 5, 2023
946858f
fix(documentdb): remove is_ha_cluter on test
Monitob Oct 5, 2023
989e265
fix(documentdb): remove telemetry_enabled on test
Monitob Oct 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- Cockpit
- Container
- Domain
- DocumentDB
- Function
- Iam
- Instance
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- Baremetal
- Cockpit
- Domain
- DocumentDB
- Function
- Container
- Iam
Expand Down
37 changes: 37 additions & 0 deletions docs/data-sources/documentdb_database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
subcategory: "Databases"
layout: "scaleway"
page_title: "Scaleway: scaleway_document_db_database"
---

# scaleway_document_db_database

Gets information about DocumentDB database. More on our official [site](https://www.scaleway.com/en/developers/api/document_db/)

## Example Usage

```hcl
# Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
data scaleway_document_db_database main {
instance_id = "11111111-1111-1111-1111-111111111111"
name = "foobar"
}
```

## Argument Reference

- `instance_id` - (Required) The DocumentDB instance ID.

- `name` - (Required) The name of the DocumentDB instance.

## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the database.

~> **Important:** DocumentDB databases' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{instance-id}/{database-name}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111/database`

- `owner` - The name of the owner of the database.
- `managed` - Whether the database is managed or not.
- `size` - Size of the database (in bytes).
45 changes: 45 additions & 0 deletions docs/data-sources/documentdb_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
subcategory: "Databases"
layout: "scaleway"
page_title: "Scaleway: scaleway_document_db_instance"
---

# scaleway_document_db_instance

Gets information about an DocumentDB instance. For further information see our [developers website](https://www.scaleway.com/en/developers/api/document_db/)

## Example Usage

```hcl
# Get info by name
data "scaleway_document_db_instance" "db" {
name = "foobar"
}

# Get info by instance ID
data "scaleway_document_db_instance" "db" {
instance_id = "11111111-1111-1111-1111-111111111111"
}
```

## Argument Reference

- `name` - (Optional) The name of the DocumentDB instance.
Only one of `name` and `instance_id` should be specified.

- `instance_id` - (Optional) The DocumentDB instance ID.
Only one of `name` and `instance_id` should be specified.

- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the DocumentDB instance exists.

- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the DocumentDB instance is in.

## Attributes Reference

In addition to all above arguments, the following attributes are exported:

- `id` - The ID of the DocumentDB instance.

~> **Important:** DocumentDB instances' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`

Exported attributes are the ones from `scaleway_document_db_instance` [resource](../resources/documentdb_instance.md)
49 changes: 49 additions & 0 deletions docs/resources/documentdb_database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
subcategory: "Databases"
page_title: "Scaleway: scaleway_document_db_database"
---

# scaleway_document_db_database

Creates and manages Scaleway DocumentDB database.
For more information, see [the documentation](https://developers.scaleway.com/en/products/rdb/api).

## Examples

### Basic

```hcl
resource "scaleway_document_db_database" "main" {
instance_id = "11111111-1111-1111-1111-111111111111"
name = "my-new-database"
}
```

## Arguments Reference

The following arguments are supported:

- `instance_id` - (Required) UUID of the documentdb instance.

~> **Important:** Updates to `instance_id` will recreate the Database.

- `name` - (Required) Name of the database (e.g. `my-new-database`).

- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the resource exists.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id` - The ID of the database, which is of the form `{region}/{id}/{DBNAME}` e.g. `fr-par/11111111-1111-1111-1111-111111111111/mydb`
- `owner` - The name of the owner of the database.
- `managed` - Whether the database is managed or not.
- `size` - Size in gigabytes of the database.

## Import

DocumentDB Database can be imported using the `{region}/{id}/{DBNAME}`, e.g.

```bash
$ terraform import scaleway_document_db_database.mydb fr-par/11111111-1111-1111-1111-111111111111/mydb
```
83 changes: 83 additions & 0 deletions docs/resources/documentdb_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
subcategory: "Databases"
page_title: "Scaleway: scaleway_documentdb_instance"
---

# scaleway_documentdb_instance

Creates and manages Scaleway Database Instances.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Examples

### Example Basic

```hcl
resource "scaleway_documentdb_instance" "main" {
name = "test-documentdb-instance-basic"
node_type = "docdb-play2-pico"
engine = "FerretDB-1"
user_name = "my_initial_user"
password = "thiZ_is_v&ry_s3cret"
tags = ["terraform-test", "scaleway_documentdb_instance", "minimal"]
volume_size_in_gb = 20
}
```

## Arguments Reference

The following arguments are supported:

- `node_type` - (Required) The type of database instance you want to create (e.g. `docdb-play2-pico`).

~> **Important:** Updates to `node_type` will upgrade the Database Instance to the desired `node_type` without any
interruption. Keep in mind that you cannot downgrade a Database Instance.

- `engine` - (Required) Database Instance's engine version (e.g. `FerretDB-1`).

~> **Important:** Updates to `engine` will recreate the Database Instance.

- `volume_type` - (Optional, default to `lssd`) Type of volume where data are stored (`bssd` or `lssd`).

- `volume_size_in_gb` - (Optional) Volume size (in GB) when `volume_type` is set to `bssd`.

- `user_name` - (Optional) Identifier for the first user of the database instance.

~> **Important:** Updates to `user_name` will recreate the Database Instance.

- `password` - (Optional) Password for the first user of the database instance.

- `is_ha_cluster` - (Optional) Enable or disable high availability for the database instance.

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

~> **Important:** Updates to `is_ha_cluster` will recreate the Database Instance.

- `name` - (Optional) The name of the Database Instance.

- `tags` - (Optional) The tags associated with the Database Instance.

- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions)
in which the Database Instance should be created.

- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the Database
Instance is associated with.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id` - The ID of the Database Instance.

~> **Important:** Database instances' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they
are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`

- `organization_id` - The organization ID the Database Instance is associated with.

## Import

Database Instance can be imported using the `{region}/{id}`, e.g.

```bash
$ terraform import scaleway_documentdb_instance.db fr-par/11111111-1111-1111-1111-111111111111
```
69 changes: 69 additions & 0 deletions docs/resources/documentdb_private_network_endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
subcategory: "Databases"
page_title: "Scaleway: scaleway_document_db_private_network_endpoint"
---

# scaleway_document_db_private_network_endpoint

Creates and manages Scaleway Database Private Network Endpoint.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Examples

### Example Basic

```hcl
resource "scaleway_vpc_private_network" "pn" {
name = "my_private_network"
}

resource "scaleway_document_db_private_network_endpoint" "main" {
instance_id = "11111111-1111-1111-1111-111111111111"
private_network {
ip_net = "172.16.32.3/22"
id = scaleway_vpc_private_network.pn.id
}
depends_on = [scaleway_vpc_private_network.pn]
}
```

## Arguments Reference

The following arguments are supported:

- `instance_id` - (Required) UUID of the documentdb instance.

- `ip_net` - (Optional) The IP network address within the private subnet. This must be an IPv4 address with a
CIDR notation. The IP network address within the private subnet is determined by the IP Address Management (IPAM)
service if not set.

- `private_network_id` - (Required) The ID of the private network.

## Private Network

~> **Important:** Updates to `private_network_id` will recreate the attachment Instance.

~> **NOTE:** Please calculate your host IP.
using [cirhost](https://developer.hashicorp.com/terraform/language/functions/cidrhost). Otherwise, lets IPAM service
handle the host IP on the network.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `ip` - IPv4 address on the network.
- `port` - Port in the Private Network.
- `name` - Name of the endpoint.
- `hostname` - Hostname of the endpoint.


~> **Important:** Database instances' IDs are [regional](../guides/regions_and_zones.md#resource-ids), which means they
are of the form `{region}/{id}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111`

## Import

Database Instance Endpoint can be imported using the `{region}/{endpoint_id}`, e.g.

```bash
$ terraform import scaleway_document_db_private_network_endpoint.end fr-par/11111111-1111-1111-1111-111111111111
```
49 changes: 49 additions & 0 deletions docs/resources/documentdb_privilege.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
subcategory: "Databases"
page_title: "Scaleway: scaleway_document_db_privilege"
---

# scaleway_document_db_privilege

Create and manage Scaleway DocumentDB database privilege.
For more information, see [the documentation](https://www.scaleway.com/en/developers/api/document_db/).

## Example usage

```hcl
resource "scaleway_document_db_privilege" "main" {
instance_id = "11111111-1111-1111-1111-111111111111"
user_name = "my-db-user"
database_name = "my-db-name"
permission = "all"
}

```

## Argument Reference

The following arguments are supported:

- `instance_id` - (Required) UUID of the rdb instance.

- `user_name` - (Required) Name of the user (e.g. `my-db-user`).

- `database_name` - (Required) Name of the database (e.g. `my-db-name`).

- `permission` - (Required) Permission to set. Valid values are `readonly`, `readwrite`, `all`, `custom` and `none`.

- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#regions) in which the resource exists.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id` - The ID of the user privileges, which is of the form `{region}/{instance_id}/{database_name}/{user_name}`, e.g. `fr-par/11111111-1111-1111-1111-111111111111/database_name/foo`

## Import

The user privileges can be imported using the `{region}/{instance_id}/{database_name}/{user_name}`, e.g.

```bash
$ terraform import scaleway_document_db_privilege.o fr-par/11111111-1111-1111-1111-111111111111/database_name/foo
```
Loading