Skip to content

Commit 4bed7e2

Browse files
committed
feat(mongodb): add datasource doc
1 parent 87623d3 commit 4bed7e2

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

docs/data-sources/mongodb_instance.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
---
3+
subcategory: "MongoDB"
4+
page_title: "Scaleway: scaleway_mongodb_instance"
5+
---
6+
7+
# scaleway_mongodb_instance
8+
9+
Gets information about a MongoDB Instance.
10+
11+
For further information refer to the Managed Databases for MongoDB [API documentation](https://developers.scaleway.com/en/products/mongodb/api/)
12+
13+
## Example Usage
14+
15+
```hcl
16+
# Get info by name
17+
data "scaleway_mongodb_instance" "my_instance" {
18+
name = "foobar"
19+
}
20+
21+
# Get info by instance ID
22+
data "scaleway_mongodb_instance" "my_instance" {
23+
instance_id = "11111111-1111-1111-1111-111111111111"
24+
}
25+
26+
# Get other attributes
27+
output "mongodb_version" {
28+
description = "Version of the MongoDB instance"
29+
value = data.scaleway_mongodb_instance.my_instance.version
30+
}
31+
```
32+
33+
## Argument Reference
34+
35+
- `name` - (Optional) The name of the MongoDB instance.
36+
37+
- `instance_id` - (Optional) The MongoDB instance ID.
38+
39+
-> **Note** You must specify at least one: `name` or `instance_id`.
40+
41+
- `project_id` - (Optional) The ID of the project the MongoDB instance is in. Can be used to filter instances when using `name`.
42+
43+
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the MongoDB Instance exists.
44+
45+
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the MongoDB instance is in.
46+
47+
## Attributes Reference
48+
49+
In addition to all above arguments, the following attributes are exported:
50+
51+
- `id` - The ID of the MongoDB Instance.
52+
- `name` - The name of the MongoDB instance.
53+
- `version` - The version of MongoDB running on the instance.
54+
- `node_type` - The type of MongoDB node.
55+
- `node_number` - The number of nodes in the MongoDB cluster.
56+
- `created_at` - The date and time the MongoDB instance was created.
57+
- `project_id` - The ID of the project the instance belongs to.
58+
- `tags` - A list of tags attached to the MongoDB instance.
59+
- `volume_type` - The type of volume attached to the MongoDB instance.
60+
- `volume_size_in_gb` - The size of the attached volume, in GB.
61+
- `public_network` - The details of the public network configuration, if applicable.
62+
63+
## Import
64+
65+
MongoDB™ instance can be imported using the `id`, e.g.
66+
67+
```bash
68+
terraform import scaleway_mongodb_instance.main fr-par-1/11111111-1111-1111-1111-111111111111
69+
```

docs/resources/mongodb_instance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The following arguments are supported:
5555

5656
## Attributes Reference
5757

58-
In addition to the arguments above, the following attributes are exported:
58+
In addition to all arguments above, the following attributes are exported:
5959

6060
- `id` - The ID of the MongoDB instance.
6161
- `created_at` - The date and time of the creation of the MongoDB instance.

0 commit comments

Comments
 (0)