Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions docs/data-sources/mongodbflex_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "stackit_mongodbflex_user Data Source - stackit"
subcategory: ""
description: |-
PostgresFlex user data source schema. Must have a region specified in the provider configuration.
MongoDB Flex user data source schema. Must have a region specified in the provider configuration.
---

# stackit_mongodbflex_user (Data Source)

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

## Example Usage

Expand All @@ -24,7 +24,7 @@ data "stackit_mongodbflex_instance" "example" {

### Required

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

Expand Down
12 changes: 6 additions & 6 deletions stackit/internal/services/mongodbflex/user/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure

var apiClient *mongodbflex.APIClient
var err error
if providerData.PostgresFlexCustomEndpoint != "" {
if providerData.MongoDBFlexCustomEndpoint != "" {
apiClient, err = mongodbflex.NewAPIClient(
config.WithCustomAuth(providerData.RoundTripper),
config.WithEndpoint(providerData.PostgresFlexCustomEndpoint),
config.WithEndpoint(providerData.MongoDBFlexCustomEndpoint),
)
} else {
apiClient, err = mongodbflex.NewAPIClient(
Expand All @@ -84,16 +84,16 @@ func (r *userDataSource) Configure(ctx context.Context, req datasource.Configure
}

r.client = apiClient
tflog.Info(ctx, "PostgresFlex user client configured")
tflog.Info(ctx, "MongoDB Flex user client configured")
}

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

Expand Down Expand Up @@ -181,7 +181,7 @@ func (r *userDataSource) Read(ctx context.Context, req datasource.ReadRequest, r
if resp.Diagnostics.HasError() {
return
}
tflog.Info(ctx, "PostgresFlex user read")
tflog.Info(ctx, "MongoDB Flex user read")
}

func mapDataSourceFields(userResp *mongodbflex.GetUserResponse, model *DataSourceModel) error {
Expand Down
4 changes: 2 additions & 2 deletions stackit/internal/services/mongodbflex/user/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ func (r *userResource) ImportState(ctx context.Context, req resource.ImportState
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("instance_id"), idParts[1])...)
resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("user_id"), idParts[2])...)
core.LogAndAddWarning(ctx, &resp.Diagnostics,
"Postgresflex user imported with empty password",
"MongoDB Flex user imported with empty password",
"The user password is not imported as it is only available upon creation of a new user. The password field will be empty.",
)
tflog.Info(ctx, "Postgresflex user state imported")
tflog.Info(ctx, "MongoDB Flex user state imported")
}

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