Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ We recommend you install the following CLI tools:
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'. Starting from RHCS Terraform provider version 1.7.7, this attribute no longer has a default value and is computed by the API. | `string` | `null` | no |
| <a name="input_wait_for_create_complete"></a> [wait\_for\_create\_complete](#input\_wait\_for\_create\_complete) | Wait until the cluster is either in a ready state or in an error state. The waiter has a timeout of 20 minutes. (default: true) | `bool` | `true` | no |
| <a name="input_wait_for_std_compute_nodes_complete"></a> [wait\_for\_std\_compute\_nodes\_complete](#input\_wait\_for\_std\_compute\_nodes\_complete) | Wait until the initial set of machine pools to be available. The waiter has a timeout of 60 minutes. (default: true) | `bool` | `true` | no |
| <a name="input_worker_disk_size"></a> [worker\_disk\_size](#input\_worker\_disk\_size) | Default worker machine pool root disk size in GiB (e.g., 300, 400, 500). Leave null to use platform default. | `number` | `null` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ module "rosa_cluster_hcp" {
replicas = var.replicas
compute_machine_type = var.compute_machine_type
aws_availability_zones = var.aws_availability_zones
worker_disk_size = var.worker_disk_size
aws_additional_compute_security_group_ids = var.aws_additional_compute_security_group_ids

########
Expand Down
1 change: 1 addition & 0 deletions modules/rosa-cluster-hcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ No modules.
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'. Starting from RHCS Terraform provider version 1.7.7, this attribute no longer has a default value and is computed by the API. | `string` | `null` | no |
| <a name="input_wait_for_create_complete"></a> [wait\_for\_create\_complete](#input\_wait\_for\_create\_complete) | Wait until the cluster is either in a ready state or in an error state. The waiter has a timeout of 20 minutes. (default: true) | `bool` | `true` | no |
| <a name="input_wait_for_std_compute_nodes_complete"></a> [wait\_for\_std\_compute\_nodes\_complete](#input\_wait\_for\_std\_compute\_nodes\_complete) | Wait until the cluster standard compute nodes are available. The waiter has a timeout of 60 minutes. (default: true) | `bool` | `true` | no |
| <a name="input_worker_disk_size"></a> [worker\_disk\_size](#input\_worker\_disk\_size) | Worker node root disk size in GiB. | `number` | `null` | no |
| <a name="input_worker_role_arn"></a> [worker\_role\_arn](#input\_worker\_role\_arn) | The Amazon Resource Name (ARN) associated with the AWS IAM role that will be used by the cluster's compute instances. | `string` | `null` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions modules/rosa-cluster-hcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ resource "rhcs_cluster_rosa_hcp" "rosa_hcp_cluster" {
replicas = var.replicas
aws_subnet_ids = var.aws_subnet_ids
compute_machine_type = var.compute_machine_type
worker_disk_size = var.worker_disk_size
Comment thread
coderabbitai[bot] marked this conversation as resolved.
create_admin_user = local.create_admin_user
admin_credentials = local.admin_credentials
ec2_metadata_http_tokens = var.ec2_metadata_http_tokens
Expand Down
38 changes: 38 additions & 0 deletions modules/rosa-cluster-hcp/tests/rosa_cluster_hcp.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,41 @@ run "invalid_channel_three_part_version" {
var.channel,
]
}

# worker_disk_size passthrough: null value (platform default).
run "worker_disk_size_null" {
command = plan

providers = {
aws = aws.default
rhcs = rhcs.import_sim
}

variables {
worker_disk_size = null
}

assert {
condition = rhcs_cluster_rosa_hcp.rosa_hcp_cluster.worker_disk_size == null
error_message = "worker_disk_size must be null when set to null (platform default)."
}
}

# worker_disk_size passthrough: explicit value (400 GiB).
run "worker_disk_size_explicit" {
command = plan

providers = {
aws = aws.default
rhcs = rhcs.import_sim
}

variables {
worker_disk_size = 400
}

assert {
condition = rhcs_cluster_rosa_hcp.rosa_hcp_cluster.worker_disk_size == 400
error_message = "worker_disk_size must be 400 when explicitly set to 400."
}
}
14 changes: 14 additions & 0 deletions modules/rosa-cluster-hcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ variable "aws_availability_zones" {
description = "The AWS availability zones where instances of the default worker machine pool are deployed. Leave empty for the installer to pick availability zones"
}

variable "worker_disk_size" {
type = number
default = null
description = "Worker node root disk size in GiB."

validation {
condition = var.worker_disk_size == null ? true : (
var.worker_disk_size > 0 &&
floor(var.worker_disk_size) == var.worker_disk_size
)
error_message = "worker_disk_size must be a positive whole number (GiB)."
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

variable "aws_additional_compute_security_group_ids" {
type = list(string)
default = null
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ variable "aws_availability_zones" {
description = "The AWS availability zones where instances of the default worker machine pool are deployed. Leave empty for the installer to pick availability zones"
}

variable "worker_disk_size" {
type = number
default = null
description = "Default worker machine pool root disk size in GiB (e.g., 300, 400, 500). Leave null to use platform default."
}

variable "aws_additional_compute_security_group_ids" {
type = list(string)
default = null
Expand Down