From 97ebb0cd31e868198acbdf34d0591323b4c53537 Mon Sep 17 00:00:00 2001 From: den-rgb Date: Fri, 6 Dec 2024 11:56:44 +0000 Subject: [PATCH] OCM-12705 | feat: Add min/max replica values to docs --- docs/data-sources/hcp_machine_pool.md | 6 ++--- docs/data-sources/machine_pool.md | 6 ++--- docs/resources/cluster_rosa_classic.md | 6 ++--- docs/resources/cluster_rosa_hcp.md | 2 +- docs/resources/hcp_machine_pool.md | 6 ++--- docs/resources/machine_pool.md | 6 ++--- .../classic/cluster_rosa_classic_resource.go | 24 ++++++++++++++----- provider/clusterrosa/hcp/resource.go | 4 ++++ .../classic/machine_pool_datasource.go | 22 ++++++++++++----- .../classic/machine_pool_resource.go | 21 +++++++++++----- provider/machinepool/hcp/autoscaling.go | 22 ++++++++++------- .../hcp/machine_pool_datasource.go | 8 +++++-- .../machinepool/hcp/machine_pool_resource.go | 8 +++++-- 13 files changed, 95 insertions(+), 46 deletions(-) diff --git a/docs/data-sources/hcp_machine_pool.md b/docs/data-sources/hcp_machine_pool.md index d50d355b..f2e6bd54 100644 --- a/docs/data-sources/hcp_machine_pool.md +++ b/docs/data-sources/hcp_machine_pool.md @@ -42,7 +42,7 @@ data "rhcs_hcp_machine_pool" "machine_pool" { - `ignore_deletion_error` (Boolean) Indicates to the provider to disregard API errors when deleting the machine pool. This will remove the resource from the management file, but not necessirely delete the underlying pool in case it errors. Setting this to true can bypass issues when destroying the cluster resource alongside the pool resource in the same management file. This is not recommended to be set in other use cases - `kubelet_configs` (String) Name of the kubelet config applied to the machine pool. - `labels` (Map of String) Labels for the machine pool. Format should be a comma-separated list of 'key = value'. This list will overwrite any modifications made to node labels on an ongoing basis. -- `replicas` (Number) The number of machines of the pool +- `replicas` (Number) The number of machines in the pool. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 250 for cluster versions prior to 4.14.0-0.a, and 500 for cluster versions 4.14.0-0.a and later. - `status` (Attributes) HCP replica status (see [below for nested schema](#nestedatt--status)) - `subnet_id` (String) Select the subnet in which to create a single AZ machine pool for BYO-VPC cluster. After the creation of the resource, it is not possible to update the attribute value. - `taints` (Attributes List) Taints for a machine pool. Format should be a comma-separated list of 'key=value'. This list will overwrite any modifications made to node taints on an ongoing basis. (see [below for nested schema](#nestedatt--taints)) @@ -55,8 +55,8 @@ data "rhcs_hcp_machine_pool" "machine_pool" { Read-Only: - `enabled` (Boolean) Enables autoscaling. If `true`, this variable requires you to set a maximum and minimum replicas range using the `max_replicas` and `min_replicas` variables. -- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality. -- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality. +- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality.The maximum is 250 for cluster versions prior to 4.14.0-0.a, and 500 for cluster versions 4.14.0-0.a and later. +- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality.Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. diff --git a/docs/data-sources/machine_pool.md b/docs/data-sources/machine_pool.md index 60c897a5..c9cde700 100644 --- a/docs/data-sources/machine_pool.md +++ b/docs/data-sources/machine_pool.md @@ -37,12 +37,12 @@ data "rhcs_machine_pool" "machine_pool" { - `ignore_deletion_error` (Boolean) Indicates to the provider to disregard API errors when deleting the machine pool. This will remove the resource from the management file, but not necessirely delete the underlying pool in case it errors. Setting this to true can bypass issues when destroying the cluster resource alongside the pool resource in the same management file. This is not recommended to be set in other use cases - `labels` (Map of String) The list of the Labels of this machine pool. - `machine_type` (String) Identifier of the machine type used by the nodes, for example `m5.xlarge`. -- `max_replicas` (Number) The maximum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true' +- `max_replicas` (Number) The maximum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true'The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. - `max_spot_price` (Number) Max Spot price. -- `min_replicas` (Number) The minimum number of replicas for autos-caling functionality. relevant only in case of 'autoscaling_enabled = true +- `min_replicas` (Number) The minimum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true' Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. - `multi_availability_zone` (Boolean) Specifies whether this machine pool is a multi-AZ machine pool. Relevant only in case of multi-AZ cluster - `name` (String) The name of the machine pool -- `replicas` (Number) The machines number in the machine pool. relevant only in case of 'autoscaling_enabled = false' +- `replicas` (Number) The number of machines in the pool. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. relevant only in case of 'autoscaling_enabled = false'. - `subnet_id` (String) An ID of single subnet in which the machines of this machine pool are created. Relevant only for a machine pool with single subnet. For machine pool with multiple subnets check "subnet_ids" attribute - `subnet_ids` (List of String) A list of IDs of subnets in which the machines of this machine pool are created. Relevant only for a machine pool with multiple subnets. For machine pool with single subnet check "subnet_id" attribute - `taints` (Attributes List) The list of the Taints of this machine pool. (see [below for nested schema](#nestedatt--taints)) diff --git a/docs/resources/cluster_rosa_classic.md b/docs/resources/cluster_rosa_classic.md index 78efaee4..777221ef 100644 --- a/docs/resources/cluster_rosa_classic.md +++ b/docs/resources/cluster_rosa_classic.md @@ -78,15 +78,15 @@ resource "rhcs_cluster_rosa_classic" "rosa_sts_cluster" { - `kms_key_arn` (String) Used to encrypt root volume of compute node pools. The key ARN is the Amazon Resource Name (ARN) of a AWS Key Management Service (KMS) Key. It is a unique, fully qualified identifier for the AWS KMS Key. A key ARN includes the AWS account, Region, and the key ID(optional). After the creation of the resource, it is not possible to update the attribute value. - `machine_cidr` (String) Block of IP addresses for nodes. After the creation of the resource, it is not possible to update the attribute value. - `max_cluster_wait_timeout_in_minutes` (Number) This value sets the maximum duration in minutes to wait for the cluster to be in a ready state. -- `max_replicas` (Number) Maximum replicas of worker nodes in a machine pool. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) -- `min_replicas` (Number) Minimum replicas of worker nodes in a machine pool. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) +- `max_replicas` (Number) Maximum replicas of worker nodes in a machine pool. The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) +- `min_replicas` (Number) Minimum replicas of worker nodes in a machine pool. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) - `multi_az` (Boolean) Indicates if the cluster should be deployed to multiple availability zones. Default value is 'false'. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) - `pod_cidr` (String) Block of IP addresses for pods. After the creation of the resource, it is not possible to update the attribute value. - `private` (Boolean) Restrict cluster API endpoint and application routes to, private connectivity. This requires that PrivateLink be enabled and by extension, your own VPC. After the creation of the resource, it is not possible to update the attribute value. - `private_hosted_zone` (Attributes) Used in a shared VPC topology. HostedZone attributes. After the creation of the resource, it is not possible to update the attribute value. (see [below for nested schema](#nestedatt--private_hosted_zone)) - `properties` (Map of String) User defined properties. - `proxy` (Attributes) proxy (see [below for nested schema](#nestedatt--proxy)) -- `replicas` (Number) Number of worker/compute nodes to provision. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) +- `replicas` (Number) Number of worker/compute nodes to provision. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters.This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) - `service_cidr` (String) Block of IP addresses for the cluster service network. After the creation of the resource, it is not possible to update the attribute value. - `sts` (Attributes) STS configuration. (see [below for nested schema](#nestedatt--sts)) - `tags` (Map of String) Apply user defined tags to all cluster resources created in AWS. After the creation of the resource, it is not possible to update the attribute value. diff --git a/docs/resources/cluster_rosa_hcp.md b/docs/resources/cluster_rosa_hcp.md index a87507a5..131219f1 100644 --- a/docs/resources/cluster_rosa_hcp.md +++ b/docs/resources/cluster_rosa_hcp.md @@ -82,7 +82,7 @@ resource "rhcs_cluster_rosa_hcp" "rosa_sts_cluster" { - `properties` (Map of String) User defined properties. It is essential to include property 'role_creator_arn' with the value of the user creating the cluster. Example: properties = {rosa_creator_arn = data.aws_caller_identity.current.arn} - `proxy` (Attributes) proxy (see [below for nested schema](#nestedatt--proxy)) - `registry_config` (Attributes) Registry configuration for this cluster. (see [below for nested schema](#nestedatt--registry_config)) -- `replicas` (Number) Number of worker/compute nodes to provision. Requires that the number supplied be a multiple of the number of private subnets. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) +- `replicas` (Number) Number of worker/compute nodes to provision. Requires that the number supplied be a multiple of the number of private subnets. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 250 for cluster versions prior to 4.14.0-0.a, and 500 for cluster versions 4.14.0-0.a and later.This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md) - `service_cidr` (String) Block of IP addresses for the cluster service network. After the creation of the resource, it is not possible to update the attribute value. - `shared_vpc` (Attributes) Shared VPC configuration.After the creation of the resource, it is not possible to update the attribute value. (see [below for nested schema](#nestedatt--shared_vpc)) - `tags` (Map of String) Apply user defined tags to all cluster resources created in AWS. After the creation of the resource, it is not possible to update the attribute value. diff --git a/docs/resources/hcp_machine_pool.md b/docs/resources/hcp_machine_pool.md index 73e72eb5..a9083a52 100644 --- a/docs/resources/hcp_machine_pool.md +++ b/docs/resources/hcp_machine_pool.md @@ -45,7 +45,7 @@ resource "rhcs_hcp_machine_pool" "machine_pool" { - `ignore_deletion_error` (Boolean) Indicates to the provider to disregard API errors when deleting the machine pool. This will remove the resource from the management file, but not necessirely delete the underlying pool in case it errors. Setting this to true can bypass issues when destroying the cluster resource alongside the pool resource in the same management file. This is not recommended to be set in other use cases - `kubelet_configs` (String) Name of the kubelet config applied to the machine pool. A single kubelet config is allowed. Kubelet config must already exist. - `labels` (Map of String) Labels for the machine pool. Format should be a comma-separated list of 'key = value'. This list will overwrite any modifications made to node labels on an ongoing basis. -- `replicas` (Number) The number of machines of the pool +- `replicas` (Number) The number of machines in the pool. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 250 for cluster versions prior to 4.14.0-0.a, and 500 for cluster versions 4.14.0-0.a and later. - `taints` (Attributes List) Taints for a machine pool. Format should be a comma-separated list of 'key=value'. This list will overwrite any modifications made to node taints on an ongoing basis. (see [below for nested schema](#nestedatt--taints)) - `tuning_configs` (List of String) A list of tuning configs attached to the pool. - `upgrade_acknowledgements_for` (String) Indicates acknowledgement of agreements required to upgrade the cluster version between minor versions (e.g. a value of "4.12" indicates acknowledgement of any agreements required to upgrade to OpenShift 4.12.z from 4.11 or before). @@ -67,8 +67,8 @@ Required: Optional: -- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality. -- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality. +- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality.The maximum is 250 for cluster versions prior to 4.14.0-0.a, and 500 for cluster versions 4.14.0-0.a and later. +- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality.Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. diff --git a/docs/resources/machine_pool.md b/docs/resources/machine_pool.md index 329477c7..7d61d445 100644 --- a/docs/resources/machine_pool.md +++ b/docs/resources/machine_pool.md @@ -40,11 +40,11 @@ resource "rhcs_machine_pool" "machine_pool" { - `disk_size` (Number) Root disk size, in GiB. After the creation of the resource, it is not possible to update the attribute value. - `ignore_deletion_error` (Boolean) Indicates to the provider to disregard API errors when deleting the machine pool. This will remove the resource from the management file, but not necessirely delete the underlying pool in case it errors. Setting this to true can bypass issues when destroying the cluster resource alongside the pool resource in the same management file. This is not recommended to be set in other use cases - `labels` (Map of String) Labels for the machine pool. Format should be a comma-separated list of 'key = value'. This list will overwrite any modifications made to node labels on an ongoing basis. -- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality. +- `max_replicas` (Number) The maximum number of replicas for autoscaling functionality.The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. - `max_spot_price` (Number) Max Spot price. After the creation of the resource, it is not possible to update the attribute value. -- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality. +- `min_replicas` (Number) The minimum number of replicas for autoscaling functionality. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. - `multi_availability_zone` (Boolean) Create a multi-AZ machine pool for a multi-AZ cluster (default is `true`). After the creation of the resource, it is not possible to update the attribute value. -- `replicas` (Number) The number of machines of the pool +- `replicas` (Number) The number of machines in the pool. Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes. The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. - `subnet_id` (String) Select the subnet in which to create a single AZ machine pool for BYO-VPC cluster. After the creation of the resource, it is not possible to update the attribute value. - `taints` (Attributes List) Taints for a machine pool. Format should be a comma-separated list of 'key=value'. This list will overwrite any modifications made to node taints on an ongoing basis. (see [below for nested schema](#nestedatt--taints)) - `use_spot_instances` (Boolean) Use Amazon EC2 Spot Instances. After the creation of the resource, it is not possible to update the attribute value. diff --git a/provider/clusterrosa/classic/cluster_rosa_classic_resource.go b/provider/clusterrosa/classic/cluster_rosa_classic_resource.go index 7dc906c5..8f1bbd3d 100644 --- a/provider/clusterrosa/classic/cluster_rosa_classic_resource.go +++ b/provider/clusterrosa/classic/cluster_rosa_classic_resource.go @@ -191,12 +191,19 @@ func (r *ClusterRosaClassicResource) Schema(ctx context.Context, req resource.Sc Optional: true, }, "min_replicas": schema.Int64Attribute{ - Description: "Minimum replicas of worker nodes in a machine pool. " + rosaTypes.PoolMessage, - Optional: true, + Description: "Minimum replicas of worker nodes in a machine pool. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + rosaTypes.PoolMessage, + Optional: true, }, "max_replicas": schema.Int64Attribute{ - Description: "Maximum replicas of worker nodes in a machine pool. " + rosaTypes.PoolMessage, - Optional: true, + Description: "Maximum replicas of worker nodes in a machine pool. " + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, " + + "for cluster versions prior to 4.14.14. " + + "For cluster versions 4.14.14 and later, " + + "the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. " + + rosaTypes.PoolMessage, + Optional: true, }, "api_url": schema.StringAttribute{ Description: "URL of the API server.", @@ -225,8 +232,13 @@ func (r *ClusterRosaClassicResource) Schema(ctx context.Context, req resource.Sc }, }, "replicas": schema.Int64Attribute{ - Description: "Number of worker/compute nodes to provision. Single zone clusters need at least 2 nodes, " + - "multizone clusters need at least 3 nodes. " + rosaTypes.PoolMessage, + Description: "Number of worker/compute nodes to provision. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, " + + "for cluster versions prior to 4.14.14. For cluster versions 4.14.14 and later, " + + "the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters." + + rosaTypes.PoolMessage, Optional: true, }, "compute_machine_type": schema.StringAttribute{ diff --git a/provider/clusterrosa/hcp/resource.go b/provider/clusterrosa/hcp/resource.go index d65f7569..bf218c45 100644 --- a/provider/clusterrosa/hcp/resource.go +++ b/provider/clusterrosa/hcp/resource.go @@ -191,6 +191,10 @@ func (r *ClusterRosaHcpResource) Schema(ctx context.Context, req resource.Schema "replicas": schema.Int64Attribute{ Description: "Number of worker/compute nodes to provision. " + "Requires that the number supplied be a multiple of the number of private subnets. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 250 for cluster versions prior to 4.14.0-0.a, " + + "and 500 for cluster versions 4.14.0-0.a and later." + rosaTypes.PoolMessage, Optional: true, }, diff --git a/provider/machinepool/classic/machine_pool_datasource.go b/provider/machinepool/classic/machine_pool_datasource.go index 4c002eaa..7dc02b25 100644 --- a/provider/machinepool/classic/machine_pool_datasource.go +++ b/provider/machinepool/classic/machine_pool_datasource.go @@ -86,8 +86,15 @@ func (r *MachinePoolDatasource) Schema(ctx context.Context, req datasource.Schem Computed: true, }, "replicas": schema.Int64Attribute{ - Description: "The machines number in the machine pool. relevant only in case of 'autoscaling_enabled = false'", - Computed: true, + Description: "The number of machines in the pool. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, " + + "for cluster versions prior to 4.14.14. " + + "For cluster versions 4.14.14 and later, the maximum is 254 " + + "for single-AZ clusters and 255 for MultiAZ clusters. " + + "relevant only in case of 'autoscaling_enabled = false'.", + Computed: true, }, "use_spot_instances": schema.BoolAttribute{ Description: "Indicates if Amazon EC2 Spot Instances used in this machine pool.", @@ -102,12 +109,15 @@ func (r *MachinePoolDatasource) Schema(ctx context.Context, req datasource.Schem Computed: true, }, "min_replicas": schema.Int64Attribute{ - Description: "The minimum number of replicas for autos-caling functionality. relevant only in case of 'autoscaling_enabled = true", - Computed: true, + Description: "The minimum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true' " + + "Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes.", + Computed: true, }, "max_replicas": schema.Int64Attribute{ - Description: "The maximum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true'", - Computed: true, + Description: "The maximum number of replicas for auto-scaling functionality. relevant only in case of 'autoscaling_enabled = true'" + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. " + + "For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. ", + Computed: true, }, "taints": schema.ListNestedAttribute{ Description: "The list of the Taints of this machine pool.", diff --git a/provider/machinepool/classic/machine_pool_resource.go b/provider/machinepool/classic/machine_pool_resource.go index abfd44ab..527509f7 100644 --- a/provider/machinepool/classic/machine_pool_resource.go +++ b/provider/machinepool/classic/machine_pool_resource.go @@ -102,8 +102,14 @@ func (r *MachinePoolResource) Schema(ctx context.Context, req resource.SchemaReq Required: true, }, "replicas": schema.Int64Attribute{ - Description: "The number of machines of the pool", - Optional: true, + Description: "The number of machines in the pool. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, " + + "for cluster versions prior to 4.14.14. " + + "For cluster versions 4.14.14 and later, the maximum is 254 " + + "for single-AZ clusters and 255 for MultiAZ clusters.", + Optional: true, }, "use_spot_instances": schema.BoolAttribute{ Description: "Use Amazon EC2 Spot Instances. " + common.ValueCannotBeChangedStringDescription, @@ -121,12 +127,15 @@ func (r *MachinePoolResource) Schema(ctx context.Context, req resource.SchemaReq Optional: true, }, "min_replicas": schema.Int64Attribute{ - Description: "The minimum number of replicas for autoscaling functionality.", - Optional: true, + Description: "The minimum number of replicas for autoscaling functionality. Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. ", + Optional: true, }, "max_replicas": schema.Int64Attribute{ - Description: "The maximum number of replicas for autoscaling functionality.", - Optional: true, + Description: "The maximum number of replicas for autoscaling functionality." + + "The maximum is 185 for single zone clusters and 186 for multizone clusters, for cluster versions prior to 4.14.14. " + + "For cluster versions 4.14.14 and later, the maximum is 254 for single-AZ clusters and 255 for MultiAZ clusters. ", + Optional: true, }, "taints": schema.ListNestedAttribute{ Description: "Taints for a machine pool. Format should be a comma-separated " + diff --git a/provider/machinepool/hcp/autoscaling.go b/provider/machinepool/hcp/autoscaling.go index 6fcd6347..4754a24f 100644 --- a/provider/machinepool/hcp/autoscaling.go +++ b/provider/machinepool/hcp/autoscaling.go @@ -19,12 +19,15 @@ func AutoscalingResource() map[string]schema.Attribute { Required: true, }, "min_replicas": schema.Int64Attribute{ - Description: "The minimum number of replicas for autoscaling functionality.", - Optional: true, + Description: "The minimum number of replicas for autoscaling functionality." + + "Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes.", + Optional: true, }, "max_replicas": schema.Int64Attribute{ - Description: "The maximum number of replicas for autoscaling functionality.", - Optional: true, + Description: "The maximum number of replicas for autoscaling functionality." + + "The maximum is 250 for cluster versions prior to 4.14.0-0.a, " + + "and 500 for cluster versions 4.14.0-0.a and later.", + Optional: true, }, } } @@ -36,12 +39,15 @@ func AutoscalingDatasource() map[string]dsschema.Attribute { Computed: true, }, "min_replicas": schema.Int64Attribute{ - Description: "The minimum number of replicas for autoscaling functionality.", - Computed: true, + Description: "The minimum number of replicas for autoscaling functionality." + + "Single zone clusters need at least 2 nodes, multizone clusters need at least 3 nodes.", + Computed: true, }, "max_replicas": schema.Int64Attribute{ - Description: "The maximum number of replicas for autoscaling functionality.", - Computed: true, + Description: "The maximum number of replicas for autoscaling functionality." + + "The maximum is 250 for cluster versions prior to 4.14.0-0.a, " + + "and 500 for cluster versions 4.14.0-0.a and later.", + Computed: true, }, } } diff --git a/provider/machinepool/hcp/machine_pool_datasource.go b/provider/machinepool/hcp/machine_pool_datasource.go index e89b31c5..863d5fb0 100644 --- a/provider/machinepool/hcp/machine_pool_datasource.go +++ b/provider/machinepool/hcp/machine_pool_datasource.go @@ -84,8 +84,12 @@ func (r *HcpMachinePoolDatasource) Schema(ctx context.Context, req datasource.Sc }, }, "replicas": schema.Int64Attribute{ - Description: "The number of machines of the pool", - Computed: true, + Description: "The number of machines in the pool. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 250 for cluster versions prior to 4.14.0-0.a, " + + "and 500 for cluster versions 4.14.0-0.a and later.", + Computed: true, }, "autoscaling": schema.SingleNestedAttribute{ Description: "Basic autoscaling options", diff --git a/provider/machinepool/hcp/machine_pool_resource.go b/provider/machinepool/hcp/machine_pool_resource.go index 9814c37a..a54fc5b5 100644 --- a/provider/machinepool/hcp/machine_pool_resource.go +++ b/provider/machinepool/hcp/machine_pool_resource.go @@ -105,8 +105,12 @@ func (r *HcpMachinePoolResource) Schema(ctx context.Context, req resource.Schema }, }, "replicas": schema.Int64Attribute{ - Description: "The number of machines of the pool", - Optional: true, + Description: "The number of machines in the pool. " + + "Single zone clusters need at least 2 nodes, " + + "multizone clusters need at least 3 nodes. " + + "The maximum is 250 for cluster versions prior to 4.14.0-0.a, " + + "and 500 for cluster versions 4.14.0-0.a and later.", + Optional: true, }, "autoscaling": schema.SingleNestedAttribute{ Description: "Basic autoscaling options",