Skip to content
Closed
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
3 changes: 3 additions & 0 deletions docs/data-sources/mongodbflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description: |-

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

!> STACKIT provides a Terraform provider that enables the deployment and ordering of MongoDB Flex. However, please exercise caution when using Terraform, as some API calls initiated through Terraform may behave differently than expected. Before applying any changes, ensure you review them carefully or contact us if you are unsure about the usage. **Please note that updates may result in the recreation of the entire instance, which could lead to data loss.**


## Example Usage

```terraform
Expand Down
3 changes: 3 additions & 0 deletions docs/data-sources/mongodbflex_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ description: |-

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

!> STACKIT provides a Terraform provider that enables the deployment and ordering of MongoDB Flex. However, please exercise caution when using Terraform, as some API calls initiated through Terraform may behave differently than expected. Before applying any changes, ensure you review them carefully or contact us if you are unsure about the usage. **Please note that updates may result in the recreation of the entire instance, which could lead to data loss.**


## Example Usage

```terraform
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!> STACKIT provides a Terraform provider that enables the deployment and ordering of MongoDB Flex. However, please exercise caution when using Terraform, as some API calls initiated through Terraform may behave differently than expected. Before applying any changes, ensure you review them carefully or contact us if you are unsure about the usage. **Please note that updates may result in the recreation of the entire instance, which could lead to data loss.**

12 changes: 7 additions & 5 deletions stackit/internal/services/mongodbflex/instance/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import (
"context"
_ "embed"
"fmt"
"net/http"
"regexp"
Expand Down Expand Up @@ -58,6 +59,9 @@
Options types.Object `tfsdk:"options"`
}

//go:embed information-instance.md
var markdownDescription string

// Struct corresponding to Model.Flavor
type flavorModel struct {
Id types.String `tfsdk:"id"`
Expand Down Expand Up @@ -144,7 +148,7 @@
} else {
apiClient, err = mongodbflex.NewAPIClient(
config.WithCustomAuth(providerData.RoundTripper),
config.WithRegion(providerData.GetRegion()),
config.WithRegion(providerData.Region),

Check failure on line 151 in stackit/internal/services/mongodbflex/instance/resource.go

View workflow job for this annotation

GitHub Actions / CI

SA1019: providerData.Region is deprecated: Use DefaultRegion instead (staticcheck)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert this changes

)
}

Expand Down Expand Up @@ -179,7 +183,8 @@
}

resp.Schema = schema.Schema{
Description: descriptions["main"],
MarkdownDescription: descriptions["main"] + "\n\n" + markdownDescription,
Description: descriptions["main"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],
Expand Down Expand Up @@ -250,9 +255,6 @@
},
"replicas": schema.Int64Attribute{
Required: true,
PlanModifiers: []planmodifier.Int64{
int64planmodifier.RequiresReplace(),
},
Comment on lines -253 to -255
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one

},
"storage": schema.SingleNestedAttribute{
Required: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
!> STACKIT provides a Terraform provider that enables the deployment and ordering of MongoDB Flex. However, please exercise caution when using Terraform, as some API calls initiated through Terraform may behave differently than expected. Before applying any changes, ensure you review them carefully or contact us if you are unsure about the usage. **Please note that updates may result in the recreation of the entire instance, which could lead to data loss.**

9 changes: 7 additions & 2 deletions stackit/internal/services/mongodbflex/user/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import (
"context"
_ "embed"
"fmt"
"net/http"
"strings"
Expand Down Expand Up @@ -45,6 +46,9 @@
Uri types.String `tfsdk:"uri"`
}

//go:embed information-user.md
var markdownDescription string

// NewUserResource is a helper function to simplify the provider implementation.
func NewUserResource() resource.Resource {
return &userResource{}
Expand Down Expand Up @@ -83,7 +87,7 @@
} else {
apiClient, err = mongodbflex.NewAPIClient(
config.WithCustomAuth(providerData.RoundTripper),
config.WithRegion(providerData.GetRegion()),
config.WithRegion(providerData.Region),

Check failure on line 90 in stackit/internal/services/mongodbflex/user/resource.go

View workflow job for this annotation

GitHub Actions / CI

SA1019: providerData.Region is deprecated: Use DefaultRegion instead (staticcheck)
Comment on lines -86 to +90
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one

)
}

Expand All @@ -108,7 +112,8 @@
}

resp.Schema = schema.Schema{
Description: descriptions["main"],
MarkdownDescription: descriptions["main"] + "\n\n" + markdownDescription,
Description: descriptions["main"],
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Description: descriptions["id"],
Expand Down
Loading