Skip to content

Commit 6075b7d

Browse files
committed
fix: remove unnecessary validator and improve default snapshot name
1 parent 5a2bcc2 commit 6075b7d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

internal/services/mongodb/action_instance_snapshot_action.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import (
55
"fmt"
66
"time"
77

8-
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
98
"github.com/hashicorp/terraform-plugin-framework/action"
109
"github.com/hashicorp/terraform-plugin-framework/action/schema"
11-
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
1210
"github.com/hashicorp/terraform-plugin-framework/types"
1311
mongodb "github.com/scaleway/scaleway-sdk-go/api/mongodb/v1"
1412
"github.com/scaleway/scaleway-sdk-go/scw"
@@ -70,9 +68,6 @@ func (a *InstanceSnapshotAction) Schema(_ context.Context, _ action.SchemaReques
7068
"instance_id": schema.StringAttribute{
7169
Required: true,
7270
Description: "MongoDB instance ID to snapshot. Can be a plain UUID or a regional ID.",
73-
Validators: []validator.String{
74-
stringvalidator.LengthAtLeast(1),
75-
},
7671
},
7772
"region": schema.StringAttribute{
7873
Optional: true,
@@ -160,7 +155,7 @@ func (a *InstanceSnapshotAction) Invoke(ctx context.Context, req action.InvokeRe
160155

161156
snapshotName := data.Name.ValueString()
162157
if snapshotName == "" {
163-
snapshotName = "tf-mongodb-snapshot"
158+
snapshotName = "tf-mongodb-snapshot-action"
164159
}
165160

166161
var expirationTime *time.Time

0 commit comments

Comments
 (0)