Skip to content

Commit 3c67485

Browse files
authored
Fix PostgresFlex references in MongoDB Flex (#91)
* Fix PostgresFlex references in MongoDB Flex * Update docs * Re-generate docs
1 parent 9d11098 commit 3c67485

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

docs/data-sources/mongodbflex_user.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "stackit_mongodbflex_user Data Source - stackit"
44
subcategory: ""
55
description: |-
6-
PostgresFlex user data source schema. Must have a region specified in the provider configuration.
6+
MongoDB Flex user data source schema. Must have a region specified in the provider configuration.
77
---
88

99
# stackit_mongodbflex_user (Data Source)
1010

11-
PostgresFlex user data source schema. Must have a `region` specified in the provider configuration.
11+
MongoDB Flex user data source schema. Must have a `region` specified in the provider configuration.
1212

1313
## Example Usage
1414

@@ -24,7 +24,7 @@ data "stackit_mongodbflex_instance" "example" {
2424

2525
### Required
2626

27-
- `instance_id` (String) ID of the PostgresFlex instance.
27+
- `instance_id` (String) ID of the MongoDB Flex instance.
2828
- `project_id` (String) STACKIT project ID to which the instance is associated.
2929
- `user_id` (String) User ID.
3030

stackit/internal/services/mongodbflex/user/datasource.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
6666

6767
var apiClient *mongodbflex.APIClient
6868
var err error
69-
if providerData.PostgresFlexCustomEndpoint != "" {
69+
if providerData.MongoDBFlexCustomEndpoint != "" {
7070
apiClient, err = mongodbflex.NewAPIClient(
7171
config.WithCustomAuth(providerData.RoundTripper),
72-
config.WithEndpoint(providerData.PostgresFlexCustomEndpoint),
72+
config.WithEndpoint(providerData.MongoDBFlexCustomEndpoint),
7373
)
7474
} else {
7575
apiClient, err = mongodbflex.NewAPIClient(
@@ -84,16 +84,16 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
8484
}
8585

8686
r.client = apiClient
87-
tflog.Info(ctx, "PostgresFlex user client configured")
87+
tflog.Info(ctx, "MongoDB Flex user client configured")
8888
}
8989

9090
// Schema defines the schema for the data source.
9191
func (r *userDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
9292
descriptions := map[string]string{
93-
"main": "PostgresFlex user data source schema. Must have a `region` specified in the provider configuration.",
93+
"main": "MongoDB Flex user data source schema. Must have a `region` specified in the provider configuration.",
9494
"id": "Terraform's internal data source. ID. It is structured as \"`project_id`,`instance_id`,`user_id`\".",
9595
"user_id": "User ID.",
96-
"instance_id": "ID of the PostgresFlex instance.",
96+
"instance_id": "ID of the MongoDB Flex instance.",
9797
"project_id": "STACKIT project ID to which the instance is associated.",
9898
}
9999

@@ -181,7 +181,7 @@ func (r *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
181181
if resp.Diagnostics.HasError() {
182182
return
183183
}
184-
tflog.Info(ctx, "PostgresFlex user read")
184+
tflog.Info(ctx, "MongoDB Flex user read")
185185
}
186186

187187
func mapDataSourceFields(userResp *mongodbflex.GetUserResponse, model *DataSourceModel) error {

stackit/internal/services/mongodbflex/user/resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ func (r *userResource) ImportState(ctx context.Context, req resource.ImportState
328328
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("instance_id"), idParts[1])...)
329329
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("user_id"), idParts[2])...)
330330
core.LogAndAddWarning(ctx, &resp.Diagnostics,
331-
"Postgresflex user imported with empty password",
331+
"MongoDB Flex user imported with empty password",
332332
"The user password is not imported as it is only available upon creation of a new user. The password field will be empty.",
333333
)
334-
tflog.Info(ctx, "Postgresflex user state imported")
334+
tflog.Info(ctx, "MongoDB Flex user state imported")
335335
}
336336

337337
func mapFieldsCreate(userResp *mongodbflex.CreateUserResponse, model *Model) error {

0 commit comments

Comments
 (0)