Skip to content

Commit

Permalink
fix min zones
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Nov 12, 2024
1 parent e95607d commit 6a5389e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions modules/eks-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ module "eks_cluster" {
|------|-------------|------|---------|:--------:|
| <a name="input_access_entries"></a> [access\_entries](#input\_access\_entries) | Map of access entries to add to the cluster. | `any` | `{}` | no |
| <a name="input_authentication_mode"></a> [authentication\_mode](#input\_authentication\_mode) | The authentication mode for the cluster. | `string` | `"API"` | no |
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | A list of availability zones names in the region. This value should never be updated after resource creation, please create a new resource instead | `list(string)` | `null` | no |
| <a name="input_availability_zones_count"></a> [availability\_zones\_count](#input\_availability\_zones\_count) | The count of availability 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. | `number` | `3` | no |
| <a name="input_availability_zones"></a> [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 |
| <a name="input_availability_zones_count"></a> [availability\_zones\_count](#input\_availability\_zones\_count) | The count of availability zones to utilize within the specified AWS Region, where pairs of public and private subnets will be generated (minimum is `2`). Valid only when availability\_zones variable is not provided. | `number` | `3` | no |
| <a name="input_cluster_node_ipv4_cidr"></a> [cluster\_node\_ipv4\_cidr](#input\_cluster\_node\_ipv4\_cidr) | The CIDR block for public and private subnets of loadbalancers and nodes. Between /28 and /16. | `string` | `"10.192.0.0/16"` | no |
| <a name="input_cluster_service_ipv4_cidr"></a> [cluster\_service\_ipv4\_cidr](#input\_cluster\_service\_ipv4\_cidr) | The CIDR block to assign Kubernetes service IP addresses from. Between /24 and /12. | `string` | `"10.190.0.0/16"` | no |
| <a name="input_cluster_tags"></a> [cluster\_tags](#input\_cluster\_tags) | A map of additional tags to add to the cluster | `map(string)` | `{}` | no |
Expand Down
4 changes: 2 additions & 2 deletions modules/eks-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ variable "create_ebs_gp3_default_storage_class" {

variable "availability_zones_count" {
type = number
description = "The count of availability 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."
description = "The count of availability zones to utilize within the specified AWS Region, where pairs of public and private subnets will be generated (minimum is `2`). Valid only when availability_zones variable is not provided."
default = 3
}

variable "availability_zones" {
type = list(string)
description = "A list of availability zones names in the region. This value should never be updated after resource creation, please create a new resource instead"
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
}
6 changes: 3 additions & 3 deletions test/src/custom_eks_opensearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func (suite *CustomEKSOpenSearchTestSuite) TestCustomEKSAndOpenSearch() {
"name": suite.clusterName,
"region": suite.region,
"np_desired_node_count": suite.expectedNodes,
// we test the usage of a single zone
"availability_zones_count": 1,
// we test the usage of a two zones (minimum)
"availability_zones_count": 2,
}

suite.sugaredLogger.Infow("Creating EKS cluster...", "extraVars", suite.varTf)
Expand Down Expand Up @@ -128,7 +128,7 @@ func (suite *CustomEKSOpenSearchTestSuite) TestCustomEKSAndOpenSearch() {
// idempotency test
terraform.InitAndApply(suite.T(), terraformOptions)

expectedVpcAZs := fmt.Sprintf("[%sa]", suite.varTf["region"]) // must match availability_zones_count, by default it's the first zone
expectedVpcAZs := fmt.Sprintf("[%sa %sb]", suite.varTf["region"], suite.varTf["region"]) // must match availability_zones_count
suite.Assert().Equal(expectedVpcAZs, terraform.Output(suite.T(), terraformOptions, "vpc_azs"))

sess, err := utils.GetAwsClient()
Expand Down

0 comments on commit 6a5389e

Please sign in to comment.