Skip to content

Commit 03c59a6

Browse files
committed
chore: remove computed from locality schemas
1 parent 7e15b9d commit 03c59a6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

internal/locality/regional/schemas.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ func Schema() *schema.Schema {
3131
Description: "The region you want to attach the resource to",
3232
Optional: true,
3333
ForceNew: true,
34-
Computed: true,
3534
ValidateDiagFunc: locality.ValidateStringInSliceWithWarning(allRegions(), "region"),
35+
DiffSuppressFunc: suppressSDKNullAssignment,
3636
}
3737
}
38+
39+
func suppressSDKNullAssignment(k, old, new string, d *schema.ResourceData) bool {
40+
return new == "" && old != ""
41+
}

internal/locality/zonal/schemas.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ func Schema() *schema.Schema {
3131
Description: "The zone you want to attach the resource to",
3232
Optional: true,
3333
ForceNew: true,
34-
Computed: true,
3534
ValidateDiagFunc: locality.ValidateStringInSliceWithWarning(AllZones(), "zone"),
35+
DiffSuppressFunc: suppressSDKNullAssignment,
3636
}
3737
}
38+
39+
func suppressSDKNullAssignment(k, old, new string, d *schema.ResourceData) bool {
40+
return new == "" && old != ""
41+
}

0 commit comments

Comments
 (0)