diff --git a/docs/data-sources/mongodbflex_instance.md b/docs/data-sources/mongodbflex_instance.md index b665e60f2..a7f7fc176 100644 --- a/docs/data-sources/mongodbflex_instance.md +++ b/docs/data-sources/mongodbflex_instance.md @@ -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 diff --git a/docs/data-sources/mongodbflex_user.md b/docs/data-sources/mongodbflex_user.md index 326e65bba..2259d8bf0 100644 --- a/docs/data-sources/mongodbflex_user.md +++ b/docs/data-sources/mongodbflex_user.md @@ -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 diff --git a/stackit/internal/services/mongodbflex/instance/information-instance.md b/stackit/internal/services/mongodbflex/instance/information-instance.md new file mode 100644 index 000000000..1c1cb5f48 --- /dev/null +++ b/stackit/internal/services/mongodbflex/instance/information-instance.md @@ -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.** + diff --git a/stackit/internal/services/mongodbflex/instance/resource.go b/stackit/internal/services/mongodbflex/instance/resource.go index 47d8ddae6..a4dabaad6 100644 --- a/stackit/internal/services/mongodbflex/instance/resource.go +++ b/stackit/internal/services/mongodbflex/instance/resource.go @@ -2,6 +2,7 @@ package mongodbflex import ( "context" + _ "embed" "fmt" "net/http" "regexp" @@ -58,6 +59,9 @@ type Model struct { 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"` @@ -144,7 +148,7 @@ func (r *instanceResource) Configure(ctx context.Context, req resource.Configure } else { apiClient, err = mongodbflex.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), - config.WithRegion(providerData.GetRegion()), + config.WithRegion(providerData.Region), ) } @@ -179,7 +183,8 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r } 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"], @@ -250,9 +255,6 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r }, "replicas": schema.Int64Attribute{ Required: true, - PlanModifiers: []planmodifier.Int64{ - int64planmodifier.RequiresReplace(), - }, }, "storage": schema.SingleNestedAttribute{ Required: true, diff --git a/stackit/internal/services/mongodbflex/user/information-user.md b/stackit/internal/services/mongodbflex/user/information-user.md new file mode 100644 index 000000000..1c1cb5f48 --- /dev/null +++ b/stackit/internal/services/mongodbflex/user/information-user.md @@ -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.** + diff --git a/stackit/internal/services/mongodbflex/user/resource.go b/stackit/internal/services/mongodbflex/user/resource.go index fd6aa28cf..17694162b 100644 --- a/stackit/internal/services/mongodbflex/user/resource.go +++ b/stackit/internal/services/mongodbflex/user/resource.go @@ -2,6 +2,7 @@ package mongodbflex import ( "context" + _ "embed" "fmt" "net/http" "strings" @@ -45,6 +46,9 @@ type Model struct { 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{} @@ -83,7 +87,7 @@ func (r *userResource) Configure(ctx context.Context, req resource.ConfigureRequ } else { apiClient, err = mongodbflex.NewAPIClient( config.WithCustomAuth(providerData.RoundTripper), - config.WithRegion(providerData.GetRegion()), + config.WithRegion(providerData.Region), ) } @@ -108,7 +112,8 @@ func (r *userResource) Schema(_ context.Context, _ resource.SchemaRequest, resp } 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"],