Skip to content

Commit 20f3496

Browse files
authored
Onboard MongoDB Flex user (#88)
* Onboard user * Add examples and generate docs * Adjustments after review
1 parent 2ddeb17 commit 20f3496

File tree

17 files changed

+1672
-1
lines changed

17 files changed

+1672
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_mongodbflex_instance Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
MongoDB Flex instance data source schema.
7+
---
8+
9+
# stackit_mongodbflex_instance (Data Source)
10+
11+
MongoDB Flex instance data source schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_mongodbflex_instance" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `instance_id` (String) ID of the MongoDB Flex instance.
29+
- `project_id` (String) STACKIT project ID to which the instance is associated.
30+
31+
### Read-Only
32+
33+
- `acl` (List of String) The Access Control List (ACL) for the MongoDB Flex instance.
34+
- `backup_schedule` (String)
35+
- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor))
36+
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`".
37+
- `name` (String) Instance name.
38+
- `options` (Attributes) (see [below for nested schema](#nestedatt--options))
39+
- `replicas` (Number)
40+
- `storage` (Attributes) (see [below for nested schema](#nestedatt--storage))
41+
- `version` (String)
42+
43+
<a id="nestedatt--flavor"></a>
44+
### Nested Schema for `flavor`
45+
46+
Read-Only:
47+
48+
- `cpu` (Number)
49+
- `description` (String)
50+
- `id` (String)
51+
- `ram` (Number)
52+
53+
54+
<a id="nestedatt--options"></a>
55+
### Nested Schema for `options`
56+
57+
Read-Only:
58+
59+
- `type` (String)
60+
61+
62+
<a id="nestedatt--storage"></a>
63+
### Nested Schema for `storage`
64+
65+
Read-Only:
66+
67+
- `class` (String)
68+
- `size` (Number)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_mongodbflex_user Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
PostgresFlex user data source schema.
7+
---
8+
9+
# stackit_mongodbflex_user (Data Source)
10+
11+
PostgresFlex user data source schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_mongodbflex_instance" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `instance_id` (String) ID of the PostgresFlex instance.
28+
- `project_id` (String) STACKIT project ID to which the instance is associated.
29+
- `user_id` (String) User ID.
30+
31+
### Read-Only
32+
33+
- `database` (String)
34+
- `host` (String)
35+
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`,`user_id`".
36+
- `port` (Number)
37+
- `roles` (Set of String)
38+
- `username` (String)

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Using this flow is less secure since the token is long-lived. You can provide th
120120
- `jwks_custom_endpoint` (String) Custom endpoint for the jwks API, which is used to get the json web key sets (jwks) to validate tokens when using the key flow
121121
- `logme_custom_endpoint` (String) Custom endpoint for the LogMe service
122122
- `mariadb_custom_endpoint` (String) Custom endpoint for the MariaDB service
123+
- `mongodbflex_custom_endpoint` (String) Custom endpoint for the MongoDB Flex service
123124
- `objectstorage_custom_endpoint` (String) Custom endpoint for the Object Storage service
124125
- `opensearch_custom_endpoint` (String) Custom endpoint for the OpenSearch service
125126
- `postgresflex_custom_endpoint` (String) Custom endpoint for the PostgresFlex service
@@ -130,6 +131,7 @@ Using this flow is less secure since the token is long-lived. You can provide th
130131
- `redis_custom_endpoint` (String)
131132
- `region` (String) Region will be used as the default location for regional services. Not all services require a region, some are global
132133
- `resourcemanager_custom_endpoint` (String) Custom endpoint for the Resource Manager service
134+
- `secretsmanager_custom_endpoint` (String) Custom endpoint for the Secrets Manager service
133135
- `service_account_email` (String) Service account email. It can also be set using the environment variable STACKIT_SERVICE_ACCOUNT_EMAIL
134136
- `service_account_key` (String) Service account key used for authentication. If set alongside private key, the key flow will be used to authenticate all operations.
135137
- `service_account_key_path` (String) Path for the service account key used for authentication. If set alongside the private key, the key flow will be used to authenticate all operations.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_mongodbflex_instance Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
MongoDB Flex instance resource schema.
7+
---
8+
9+
# stackit_mongodbflex_instance (Resource)
10+
11+
MongoDB Flex instance resource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_mongodbflex_instance" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
name = "example-instance"
19+
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
20+
flavor = {
21+
cpu = 1
22+
ram = 8
23+
}
24+
replicas = 1
25+
storage = {
26+
class = "class"
27+
size = 10
28+
}
29+
version = "5.0"
30+
options = {
31+
type = "Single"
32+
}
33+
}
34+
```
35+
36+
<!-- schema generated by tfplugindocs -->
37+
## Schema
38+
39+
### Required
40+
41+
- `acl` (List of String) The Access Control List (ACL) for the MongoDB Flex instance.
42+
- `flavor` (Attributes) (see [below for nested schema](#nestedatt--flavor))
43+
- `name` (String) Instance name.
44+
- `options` (Attributes) (see [below for nested schema](#nestedatt--options))
45+
- `project_id` (String) STACKIT project ID to which the instance is associated.
46+
- `replicas` (Number)
47+
- `storage` (Attributes) (see [below for nested schema](#nestedatt--storage))
48+
- `version` (String)
49+
50+
### Read-Only
51+
52+
- `backup_schedule` (String)
53+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`".
54+
- `instance_id` (String) ID of the MongoDB Flex instance.
55+
56+
<a id="nestedatt--flavor"></a>
57+
### Nested Schema for `flavor`
58+
59+
Required:
60+
61+
- `cpu` (Number)
62+
- `ram` (Number)
63+
64+
Read-Only:
65+
66+
- `description` (String)
67+
- `id` (String)
68+
69+
70+
<a id="nestedatt--options"></a>
71+
### Nested Schema for `options`
72+
73+
Required:
74+
75+
- `type` (String)
76+
77+
78+
<a id="nestedatt--storage"></a>
79+
### Nested Schema for `storage`
80+
81+
Required:
82+
83+
- `class` (String)
84+
- `size` (Number)

docs/resources/mongodbflex_user.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_mongodbflex_user Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
MongoDB Flex user resource schema.
7+
---
8+
9+
# stackit_mongodbflex_user (Resource)
10+
11+
MongoDB Flex user resource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_mongodbflex_user" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
username = "username"
20+
roles = ["role"]
21+
database = "database"
22+
}
23+
```
24+
25+
<!-- schema generated by tfplugindocs -->
26+
## Schema
27+
28+
### Required
29+
30+
- `database` (String)
31+
- `instance_id` (String) ID of the MongoDB Flex instance.
32+
- `project_id` (String) STACKIT project ID to which the instance is associated.
33+
- `roles` (Set of String) Database access levels for the user.
34+
35+
### Optional
36+
37+
- `username` (String)
38+
39+
### Read-Only
40+
41+
- `host` (String)
42+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`,`user_id`".
43+
- `password` (String, Sensitive)
44+
- `port` (Number)
45+
- `user_id` (String) User ID.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "stackit_mongodbflex_instance" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
user_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "stackit_mongodbflex_instance" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
resource "stackit_mongodbflex_instance" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
name = "example-instance"
4+
acl = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"]
5+
flavor = {
6+
cpu = 1
7+
ram = 8
8+
}
9+
replicas = 1
10+
storage = {
11+
class = "class"
12+
size = 10
13+
}
14+
version = "5.0"
15+
options = {
16+
type = "Single"
17+
}
18+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resource "stackit_mongodbflex_user" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
username = "username"
5+
roles = ["role"]
6+
database = "database"
7+
}

0 commit comments

Comments
 (0)