diff --git a/modules/rosa-hcp/README.md b/modules/rosa-hcp/README.md
index 01dcbfa..9719151 100644
--- a/modules/rosa-hcp/README.md
+++ b/modules/rosa-hcp/README.md
@@ -17,7 +17,9 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
-| [availability\_zones\_count](#input\_availability\_zones\_count) | The number of availability zones to use for the cluster (minimum 2) | `number` | `2` | no |
+| [availability\_zones](#input\_availability\_zones) | A list of availability zone names in the region. By default, this is set to `null` and is not used; instead, `availability_zones_count` manages the number of availability zones. This value should not be updated directly. To make changes, please create a new resource. | `list(string)` | `null` | no |
+| [availability\_zones\_count](#input\_availability\_zones\_count) | The count of availability (minimum 2) zones to utilize within the specified AWS Region, where pairs of public and private subnets will be generated. Valid only when availability\_zones variable is not provided. This value should not be updated, please create a new resource instead. | `number` | `2` | no |
+| [aws\_availability\_zones](#input\_aws\_availability\_zones) | The AWS availability zones where instances of the default worker machine pool are deployed. Leave empty for the installer to pick availability zones from the VPC `availability_zones` or `availability_zones_count` | `list(string)` | `[]` | no |
| [cluster\_name](#input\_cluster\_name) | The name of the ROSA cluster to create | `string` | `"my-ocp-cluster"` | no |
| [compute\_node\_instance\_type](#input\_compute\_node\_instance\_type) | The EC2 instance type to use for compute nodes | `string` | `"m5.xlarge"` | no |
| [host\_prefix](#input\_host\_prefix) | The subnet mask to assign to each compute node in the cluster | `string` | `"23"` | no |
diff --git a/modules/rosa-hcp/rosa.tf b/modules/rosa-hcp/rosa.tf
index a28e7c3..5d94276 100644
--- a/modules/rosa-hcp/rosa.tf
+++ b/modules/rosa-hcp/rosa.tf
@@ -25,7 +25,8 @@ module "rosa_hcp" {
replicas = var.replicas
- aws_availability_zones = module.vpc.availability_zones
+ aws_availability_zones = length(var.aws_availability_zones) > 0 ? var.aws_availability_zones : module.vpc.availability_zones
+
aws_subnet_ids = concat(
module.vpc.public_subnets, module.vpc.private_subnets,
)
@@ -61,8 +62,10 @@ module "vpc" {
source = "terraform-redhat/rosa-hcp/rhcs//modules/vpc"
version = "1.6.5"
- name_prefix = var.cluster_name
- availability_zones_count = var.availability_zones_count
+ name_prefix = var.cluster_name
+
+ availability_zones_count = var.availability_zones != null ? null : var.availability_zones_count
+ availability_zones = var.availability_zones
vpc_cidr = var.vpc_cidr_block
}
diff --git a/modules/rosa-hcp/vars.tf b/modules/rosa-hcp/vars.tf
index ca5879a..82de5fa 100644
--- a/modules/rosa-hcp/vars.tf
+++ b/modules/rosa-hcp/vars.tf
@@ -41,10 +41,23 @@ variable "offline_access_token" {
variable "availability_zones_count" {
type = number
- description = "The number of availability zones to use for the cluster (minimum 2)"
+ description = "The count of availability (minimum 2) zones to utilize within the specified AWS Region, where pairs of public and private subnets will be generated. Valid only when availability_zones variable is not provided. This value should not be updated, please create a new resource instead."
default = 2
}
+variable "availability_zones" {
+ type = list(string)
+ description = "A list of availability zone names in the region. By default, this is set to `null` and is not used; instead, `availability_zones_count` manages the number of availability zones. This value should not be updated directly. To make changes, please create a new resource."
+ default = null
+}
+
+
+variable "aws_availability_zones" {
+ type = list(string)
+ description = "The AWS availability zones where instances of the default worker machine pool are deployed. Leave empty for the installer to pick availability zones from the VPC `availability_zones` or `availability_zones_count`"
+ default = []
+}
+
variable "vpc_cidr_block" {
type = string
description = "value of the CIDR block to use for the VPC"