11package scaleway
22
33import (
4+ "strings"
5+
46 "github.com/hashicorp/terraform-plugin-sdk/helper/schema"
57 lb "github.com/scaleway/scaleway-sdk-go/api/lb/v1"
68 "github.com/scaleway/scaleway-sdk-go/scw"
@@ -24,10 +26,11 @@ func resourceScalewayLbBeta() *schema.Resource {
2426 Description : "Name of the lb" ,
2527 },
2628 "type" : {
27- Type : schema .TypeString ,
28- Required : true ,
29- ForceNew : true ,
30- Description : "The type of load-balancer you want to create" ,
29+ Type : schema .TypeString ,
30+ Required : true ,
31+ ForceNew : true ,
32+ DiffSuppressFunc : diffSuppressFuncIgnoreCase ,
33+ Description : "The type of load-balancer you want to create" ,
3134 },
3235 "tags" : {
3336 Type : schema .TypeList ,
@@ -116,7 +119,8 @@ func resourceScalewayLbBetaRead(d *schema.ResourceData, m interface{}) error {
116119 _ = d .Set ("region" , string (region ))
117120 _ = d .Set ("organization_id" , res .OrganizationID )
118121 _ = d .Set ("tags" , res .Tags )
119- _ = d .Set ("type" , res .Type )
122+ // For now API return lowercase lb type. This should be fix in a near future on the API side
123+ _ = d .Set ("type" , strings .ToUpper (res .Type ))
120124 _ = d .Set ("ip_id" , newRegionalId (region , res .IP [0 ].ID ))
121125 _ = d .Set ("ip_address" , res .IP [0 ].IPAddress )
122126
0 commit comments