diff --git a/scaleway/resource_k8s_pool_beta.go b/scaleway/resource_k8s_pool_beta.go index e7c9b84cc..ec41f52e4 100644 --- a/scaleway/resource_k8s_pool_beta.go +++ b/scaleway/resource_k8s_pool_beta.go @@ -115,6 +115,11 @@ func resourceScalewayK8SPoolBeta() *schema.Resource { Computed: true, Description: "The Kubernetes version of the pool", }, + "current_size": { + Type: schema.TypeInt, + Computed: true, + Description: "The actual size of the pool", + }, "nodes": { Type: schema.TypeList, Computed: true, @@ -266,7 +271,10 @@ func resourceScalewayK8SPoolBetaRead(d *schema.ResourceData, m interface{}) erro _ = d.Set("node_type", pool.NodeType) _ = d.Set("autoscaling", pool.Autoscaling) _ = d.Set("autohealing", pool.Autohealing) - _ = d.Set("size", pool.Size) + _ = d.Set("current_size", pool.Size) + if !pool.Autoscaling { + _ = d.Set("size", pool.Size) + } _ = d.Set("version", pool.Version) _ = d.Set("min_size", pool.MinSize) _ = d.Set("max_size", pool.MaxSize) diff --git a/website/docs/r/k8s_pool_beta.html.markdown b/website/docs/r/k8s_pool_beta.html.markdown index 9ab1470b7..d13a73d00 100644 --- a/website/docs/r/k8s_pool_beta.html.markdown +++ b/website/docs/r/k8s_pool_beta.html.markdown @@ -47,6 +47,7 @@ The following arguments are supported: ~> **Important:** Updates to this field will recreate a new resource. - `size` - (Required) The size of the pool. +~> **Important:** This field will only be used at creation if autoscaling is enabled. - `min_size` - (Defaults to `1`) The minimum size of the pool, used by the autoscaling feature. @@ -83,6 +84,7 @@ In addition to all above arguments, the following attributes are exported: - `created_at` - The creation date of the pool. - `updated_at` - The last update date of the pool. - `version` - The version of the pool. +- `current_size` - The size of the pool at the time the terraform state was updated. ## Import