Skip to content

Commit 1965bc6

Browse files
committed
update FileSystem Size to GB
1 parent 3575502 commit 1965bc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/services/file/filesystem.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package file
22

33
import (
44
"context"
5+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
56
"time"
67

78
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -38,9 +39,10 @@ func ResourceFileSystem() *schema.Resource {
3839
Description: "The name of the filesystem",
3940
},
4041
"size_in_gb": {
41-
Type: schema.TypeInt,
42-
Required: true,
43-
Description: "The Filesystem size_in_gb in bytes, with a granularity of 100 GB (10^11 bytes). Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size_in_gb.",
42+
Type: schema.TypeInt,
43+
Required: true,
44+
ValidateFunc: validation.IntBetween(1, 1000),
45+
Description: "The Filesystem size_in_gb in bytes, with a granularity of 100 GB (10^11 bytes). Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size_in_gb.",
4446
},
4547
"tags": {
4648
Type: schema.TypeList,
@@ -135,7 +137,6 @@ func ResourceFileSystemRead(ctx context.Context, d *schema.ResourceData, m any)
135137
_ = d.Set("organization_id", fileSystem.OrganizationID)
136138
_ = d.Set("status", fileSystem.Status)
137139
_ = d.Set("size_in_gb", int(fileSystem.Size/scw.GB))
138-
)
139140
_ = d.Set("tags", fileSystem.Tags)
140141
_ = d.Set("created_at", fileSystem.CreatedAt.Format(time.RFC3339))
141142
_ = d.Set("updated_at", fileSystem.UpdatedAt.Format(time.RFC3339))

0 commit comments

Comments
 (0)