@@ -37,6 +37,7 @@ var planTypes = map[string]attr.Type{
3737 "id" : types .StringType ,
3838 "name" : types .StringType ,
3939 "description" : types .StringType ,
40+ "min_edge_hosts" : types .Int64Type ,
4041 "max_edge_hosts" : types .Int64Type ,
4142}
4243
@@ -108,6 +109,10 @@ func (d *plansDataSource) Schema(_ context.Context, _ datasource.SchemaRequest,
108109 Description : "Description of the plan." ,
109110 Computed : true ,
110111 },
112+ "min_edge_hosts" : schema.Int64Attribute {
113+ Description : "Minimum number of Edge Cloud hosts charged." ,
114+ Computed : true ,
115+ },
111116 "max_edge_hosts" : schema.Int64Attribute {
112117 Description : "Maximum number of Edge Cloud hosts that can be used." ,
113118 Computed : true ,
@@ -190,14 +195,15 @@ func (d *plansDataSource) Read(ctx context.Context, req datasource.ReadRequest,
190195
191196// mapPlanToAttrs maps a single edge.Plan to a map of Terraform attributes.
192197func mapPlanToAttrs (plan * edge.Plan ) (map [string ]attr.Value , error ) {
193- if plan == nil || plan .Id == nil || plan .Name == nil || plan .MaxEdgeHosts == nil {
198+ if plan == nil || plan .Id == nil || plan .Name == nil || plan .MaxEdgeHosts == nil || plan . MinEdgeHosts == nil {
194199 return nil , fmt .Errorf ("received nil or incomplete plan from API" )
195200 }
196201
197202 attrs := map [string ]attr.Value {
198203 "id" : types .StringValue (plan .GetId ()),
199204 "name" : types .StringValue (plan .GetName ()),
200205 "description" : types .StringValue (plan .GetDescription ()),
206+ "min_edge_hosts" : types .Int64Value (plan .GetMinEdgeHosts ()),
201207 "max_edge_hosts" : types .Int64Value (plan .GetMaxEdgeHosts ()),
202208 }
203209
0 commit comments