|
9 | 9 | "github.com/scaleway/scaleway-sdk-go/api/inference/v1" |
10 | 10 | "github.com/scaleway/scaleway-sdk-go/scw" |
11 | 11 | scwvalidation "github.com/scaleway/scaleway-sdk-go/validation" |
| 12 | + "github.com/scaleway/terraform-provider-scaleway/v2/internal/dsf" |
12 | 13 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" |
13 | 14 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" |
14 | 15 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" |
@@ -52,22 +53,11 @@ func ResourceDeployment() *schema.Resource { |
52 | 53 | Description: "The model name to use for the deployment", |
53 | 54 | }, |
54 | 55 | "model_id": { |
55 | | - Type: schema.TypeString, |
56 | | - Required: true, |
57 | | - Description: "The model id used for the deployment", |
58 | | - ForceNew: true, |
59 | | - DiffSuppressFunc: func(k, old, newValue string, d *schema.ResourceData) bool { |
60 | | - if old == "" || newValue == "" { |
61 | | - return false |
62 | | - } |
63 | | - if !scwvalidation.IsUUID(newValue) { |
64 | | - newID := regional.ExpandID(newValue).ID |
65 | | - |
66 | | - return old == newID |
67 | | - } |
68 | | - |
69 | | - return old == newValue |
70 | | - }, |
| 56 | + Type: schema.TypeString, |
| 57 | + Required: true, |
| 58 | + Description: "The model id used for the deployment", |
| 59 | + ForceNew: true, |
| 60 | + DiffSuppressFunc: dsf.Locality, |
71 | 61 | }, |
72 | 62 | "accept_eula": { |
73 | 63 | Type: schema.TypeBool, |
@@ -197,7 +187,6 @@ func ResourceDeploymentCreate(ctx context.Context, d *schema.ResourceData, m int |
197 | 187 | } |
198 | 188 |
|
199 | 189 | modelID := d.Get("model_id") |
200 | | - |
201 | 190 | if !scwvalidation.IsUUID(modelID.(string)) { |
202 | 191 | modelID = regional.ExpandID(modelID).ID |
203 | 192 | } |
|
0 commit comments