|
8 | 8 | "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" |
9 | 9 | "github.com/scaleway/scaleway-sdk-go/api/inference/v1" |
10 | 10 | "github.com/scaleway/scaleway-sdk-go/scw" |
11 | | - scwvalidation "github.com/scaleway/scaleway-sdk-go/validation" |
12 | 11 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/dsf" |
13 | 12 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/httperrors" |
| 13 | + "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality" |
14 | 14 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional" |
15 | 15 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/services/account" |
16 | 16 | "github.com/scaleway/terraform-provider-scaleway/v2/internal/types" |
@@ -186,17 +186,12 @@ func ResourceDeploymentCreate(ctx context.Context, d *schema.ResourceData, m int |
186 | 186 | return diag.FromErr(err) |
187 | 187 | } |
188 | 188 |
|
189 | | - modelID := d.Get("model_id") |
190 | | - if !scwvalidation.IsUUID(modelID.(string)) { |
191 | | - modelID = regional.ExpandID(modelID).ID |
192 | | - } |
193 | | - |
194 | 189 | req := &inference.CreateDeploymentRequest{ |
195 | 190 | Region: region, |
196 | 191 | ProjectID: d.Get("project_id").(string), |
197 | 192 | Name: d.Get("name").(string), |
198 | 193 | NodeTypeName: d.Get("node_type").(string), |
199 | | - ModelID: modelID.(string), |
| 194 | + ModelID: locality.ExpandID(d.Get("model_id").(string)), |
200 | 195 | Tags: types.ExpandStrings(d.Get("tags")), |
201 | 196 | Endpoints: buildEndpoints(d), |
202 | 197 | } |
|
0 commit comments