@@ -22,7 +22,7 @@ func ResourceDeployment() *schema.Resource {
2222 Importer : & schema.ResourceImporter {
2323 StateContext : schema .ImportStatePassthroughContext ,
2424 },
25- Timeouts : & schema.ResourceTimeout { // TODO: remove unused timeouts
25+ Timeouts : & schema.ResourceTimeout {
2626 Create : schema .DefaultTimeout (defaultInferenceDeploymentTimeout ),
2727 Read : schema .DefaultTimeout (defaultInferenceDeploymentTimeout ),
2828 Update : schema .DefaultTimeout (defaultInferenceDeploymentTimeout ),
@@ -238,24 +238,15 @@ func ResourceDeploymentRead(ctx context.Context, d *schema.ResourceData, m inter
238238 _ = d .Set ("created_at" , types .FlattenTime (deployment .CreatedAt ))
239239 _ = d .Set ("updated_at" , types .FlattenTime (deployment .UpdatedAt ))
240240
241- if deployment .Endpoints [0 ].PrivateNetwork != nil {
242- _ = d .Set ("endpoint_private_url" , deployment .Endpoints [0 ].URL )
243- _ = d .Set ("endpoint_private_id" , deployment .Endpoints [0 ].ID )
244- _ = d .Set ("disable_auth_private" , deployment .Endpoints [0 ].DisableAuth )
245- } else {
246- _ = d .Set ("endpoint_public_url" , deployment .Endpoints [0 ].URL )
247- _ = d .Set ("endpoint_public_id" , deployment .Endpoints [0 ].ID )
248- _ = d .Set ("disable_auth_public" , deployment .Endpoints [0 ].DisableAuth )
249- }
250- if len (deployment .Endpoints ) == 2 {
251- if deployment .Endpoints [1 ].PrivateNetwork != nil {
252- _ = d .Set ("endpoint_private_url" , deployment .Endpoints [1 ].URL )
253- _ = d .Set ("endpoint_private_id" , deployment .Endpoints [1 ].ID )
254- _ = d .Set ("disable_auth_private" , deployment .Endpoints [1 ].DisableAuth )
241+ for _ , endpoint := range deployment .Endpoints {
242+ if endpoint .PrivateNetwork != nil {
243+ _ = d .Set ("endpoint_private_url" , endpoint .URL )
244+ _ = d .Set ("endpoint_private_id" , endpoint .ID )
245+ _ = d .Set ("disable_auth_private" , endpoint .DisableAuth )
255246 } else {
256- _ = d .Set ("endpoint_public_url" , deployment . Endpoints [ 1 ] .URL )
257- _ = d .Set ("endpoint_public_id" , deployment . Endpoints [ 1 ] .ID )
258- _ = d .Set ("disable_auth_public" , deployment . Endpoints [ 1 ] .DisableAuth )
247+ _ = d .Set ("endpoint_public_url" , endpoint .URL )
248+ _ = d .Set ("endpoint_public_id" , endpoint .ID )
249+ _ = d .Set ("disable_auth_public" , endpoint .DisableAuth )
259250 }
260251 }
261252 return nil
0 commit comments