Skip to content

Commit d883b86

Browse files
committed
feat(mongodb): add doc
1 parent 5cc070b commit d883b86

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

docs/resources/mongodb_instance.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,30 @@ resource "scaleway_mongodb_instance" "main" {
2525
}
2626
```
2727

28+
### Private Network
29+
30+
```terraform
31+
resource scaleway_vpc_private_network pn01 {
32+
name = "my_private_network"
33+
region = "fr-par"
34+
}
35+
36+
resource "scaleway_mongodb_instance" "main" {
37+
name = "test-mongodb-basic1"
38+
version = "7.0.12"
39+
node_type = "MGDB-PLAY2-NANO"
40+
node_number = 1
41+
user_name = "my_initial_user"
42+
password = "thiZ_is_v&ry_s3cret"
43+
volume_size_in_gb = 5
44+
45+
private_network {
46+
pn_id = "${scaleway_vpc_private_network.pn02.id}"
47+
}
48+
49+
}
50+
```
51+
2852

2953
### Restore From Snapshot
3054

@@ -51,6 +75,8 @@ The following arguments are supported:
5175
- `volume_type` - (Optional) Volume type of the instance.
5276
- `volume_size_in_gb` - (Optional) Volume size in GB.
5377
- `snapshot_id` - (Optional) Snapshot ID to restore the MongoDB® instance from.
78+
- `private_network` - (Optional) Private Network endpoints of the Database Instance.
79+
- `pn_id` - (Required) The ID of the Private Network.-
5480
- `public_network` - (Optional) Public network specs details.
5581

5682
## Attributes Reference
@@ -60,6 +86,11 @@ In addition to all arguments above, the following attributes are exported:
6086
- `id` - The ID of the MongoDB® instance.
6187
- `created_at` - The date and time of the creation of the MongoDB® instance.
6288
- `updated_at` - The date and time of the last update of the MongoDB® instance.
89+
- `private_network` - Private Network endpoints of the Database Instance.
90+
- `id` - The ID of the endpoint.
91+
- `ips` - List of IP addresses for your endpoint.
92+
- `port` - TCP port of the endpoint.
93+
- `dns_records` - List of DNS records for your endpoint.
6394

6495
## Import
6596

internal/services/mongodb/instance.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func ResourceInstance() *schema.Resource {
110110
Type: schema.TypeList,
111111
Optional: true,
112112
MaxItems: 1,
113-
Description: "List of private network to expose your database instance",
113+
Description: "Private network to expose your mongodb instance",
114114
Elem: &schema.Resource{
115115
Schema: map[string]*schema.Schema{
116116
"pn_id": {
@@ -122,8 +122,9 @@ func ResourceInstance() *schema.Resource {
122122
},
123123
// Computed
124124
"id": {
125-
Type: schema.TypeString,
126-
Computed: true,
125+
Type: schema.TypeString,
126+
Computed: true,
127+
Description: "The private network ID",
127128
},
128129
"port": {
129130
Type: schema.TypeInt,
@@ -160,8 +161,9 @@ func ResourceInstance() *schema.Resource {
160161
Elem: &schema.Resource{
161162
Schema: map[string]*schema.Schema{
162163
"id": {
163-
Type: schema.TypeString,
164-
Computed: true,
164+
Type: schema.TypeString,
165+
Computed: true,
166+
Description: "ID of the public network",
165167
},
166168
"port": {
167169
Type: schema.TypeInt,

0 commit comments

Comments
 (0)