Skip to content

Commit 1a66302

Browse files
committed
Multiple fixes
1 parent 3e21890 commit 1a66302

File tree

6 files changed

+318
-116
lines changed

6 files changed

+318
-116
lines changed

internal/locality/regional/schemas.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package regional
22

33
import (
44
resourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
5+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
6+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
57
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
68
"github.com/scaleway/scaleway-sdk-go/scw"
79
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality"
@@ -42,5 +44,9 @@ func ResourceSchema(description string) resourceSchema.Attribute {
4244
return resourceSchema.StringAttribute{
4345
Description: description,
4446
Optional: true,
47+
Computed: true,
48+
PlanModifiers: []planmodifier.String{
49+
stringplanmodifier.UseStateForUnknown(),
50+
},
4551
}
4652
}

internal/services/account/schemas.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package account
33
import (
44
dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
55
resourceSchema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
6+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
7+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
68
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
79
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
810
"github.com/scaleway/terraform-provider-scaleway/v2/internal/verify"
@@ -45,6 +47,11 @@ func ResourceProjectIDSchema(description string) resourceSchema.StringAttribute
4547
Validators: []validator.String{
4648
verify.UUIDValidator{},
4749
},
50+
Computed: true,
51+
PlanModifiers: []planmodifier.String{
52+
stringplanmodifier.UseStateForUnknown(),
53+
},
54+
MarkdownDescription: description,
4855
}
4956
}
5057

0 commit comments

Comments
 (0)