@@ -2,6 +2,7 @@ package instance
22
33import (
44 "context"
5+ "strconv"
56
67 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
78 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -192,15 +193,18 @@ func DataSourceInstanceServerTypeRead(ctx context.Context, d *schema.ResourceDat
192193 d .SetId (name )
193194 _ = d .Set ("name" , name )
194195 _ = d .Set ("arch" , serverType .Arch )
195- _ = d .Set ("cpu" , serverType .Ncpus )
196- _ = d .Set ("ram" , serverType .RAM )
197- _ = d .Set ("gpu" , serverType .Gpu )
196+ _ = d .Set ("cpu" , strconv .FormatUint (uint64 (serverType .Ncpus ), 10 ))
197+ _ = d .Set ("ram" , strconv .FormatUint (serverType .RAM , 10 ))
198198 _ = d .Set ("volumes" , flattenVolumeConstraints (serverType ))
199199 _ = d .Set ("capabilities" , flattenCapabilities (serverType .Capabilities ))
200200 _ = d .Set ("network" , flattenNetwork (serverType ))
201201 _ = d .Set ("hourly_price" , serverType .HourlyPrice )
202202 _ = d .Set ("end_of_service" , serverType .EndOfService )
203203
204+ if serverType .Gpu != nil {
205+ _ = d .Set ("gpu" , strconv .FormatUint (* serverType .Gpu , 10 ))
206+ }
207+
204208 // Availability
205209 availabilitiesResponse , err := instanceAPI .GetServerTypesAvailability (& instance.GetServerTypesAvailabilityRequest {
206210 Zone : zone ,
0 commit comments