diff --git a/internal/server/data_source.go b/internal/server/data_source.go index 162d24bb0..8706e3817 100644 --- a/internal/server/data_source.go +++ b/internal/server/data_source.go @@ -105,6 +105,10 @@ func getCommonDataSchema() map[string]*schema.Schema { Type: schema.TypeBool, Computed: true, }, + "primary_disk_size": { + Type: schema.TypeInt, + Computed: true, + }, } } diff --git a/internal/server/resource.go b/internal/server/resource.go index 13adf634a..4f1458f9a 100644 --- a/internal/server/resource.go +++ b/internal/server/resource.go @@ -1168,6 +1168,7 @@ func getServerAttributes(d *schema.ResourceData, s *hcloud.Server) map[string]in "delete_protection": s.Protection.Delete, "rebuild_protection": s.Protection.Rebuild, "firewall_ids": firewallIDs, + "primary_disk_size": s.PrimaryDiskSize, } if s.PublicNet.IPv4.IsUnspecified() { res["ipv4_address"] = nil diff --git a/website/docs/d/server.html.md b/website/docs/d/server.html.md index c18b231b2..dce2a826d 100644 --- a/website/docs/d/server.html.md +++ b/website/docs/d/server.html.md @@ -47,3 +47,4 @@ data "hcloud_server" "s_3" { - `placement_group_id` - (Optional, string) Placement Group ID the server is assigned to. - `delete_protection` - (bool) Whether delete protection is enabled. - `rebuild_protection` - (bool) Whether rebuild protection is enabled. +- `primary_disk_size` - (int) The size of the primary disk in GB. diff --git a/website/docs/r/server.html.md b/website/docs/r/server.html.md index c5e4d9400..030ddbb73 100644 --- a/website/docs/r/server.html.md +++ b/website/docs/r/server.html.md @@ -220,6 +220,7 @@ The following attributes are exported: - `delete_protection` - (bool) Whether delete protection is enabled. - `rebuild_protection` - (bool) Whether rebuild protection is enabled. - `shutdown_before_deletion` - (bool) Whether the server will try to shut down gracefully before being deleted. +- `primary_disk_size` - (int) The size of the primary disk in GB. a single entry in `network` support the following fields: - `network_id` - (Required, int) ID of the network