Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for zonal shift configuration #243

Merged
merged 1 commit into from
Nov 1, 2024
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,14 @@ Available targets:
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.34.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.74.0 |
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 3.1.0, != 4.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.34.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.74.0 |
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 3.1.0, != 4.0.0 |

## Modules
Expand Down Expand Up @@ -454,6 +454,7 @@ Available targets:
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs to launch the cluster in | `list(string)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br/>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
| <a name="input_zonal_shift_config"></a> [zonal\_shift\_config](#input\_zonal\_shift\_config) | Configuration block with zonal shift configuration for the cluster | <pre>object({<br/> enabled = optional(bool, null)<br/> })</pre> | `null` | no |

## Outputs

Expand Down
71 changes: 36 additions & 35 deletions docs/terraform.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions examples/complete/fixtures.us-east-2.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ addons = [
service_account_role_arn = null
},
]

zonal_shift_config = {
enabled = true
}
1 change: 1 addition & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ module "eks_cluster" {
addons = local.addons
addons_depends_on = [module.eks_node_group]
bootstrap_self_managed_addons_enabled = var.bootstrap_self_managed_addons_enabled
zonal_shift_config = var.zonal_shift_config

access_entry_map = local.access_entry_map
access_config = {
Expand Down
8 changes: 8 additions & 0 deletions examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ variable "bootstrap_self_managed_addons_enabled" {
default = null
}

variable "zonal_shift_config" {
type = object({
enabled = optional(bool, null)
})
description = "Configuration block with zonal shift configuration for the cluster"
default = null
}

variable "private_ipv6_enabled" {
type = bool
default = false
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34"
version = ">= 5.74"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ resource "aws_eks_cluster" "default" {
}
}

dynamic "zonal_shift_config" {
for_each = var.zonal_shift_config != null ? [var.zonal_shift_config] : []
content {
enabled = zonal_shift_config.value.enabled
}
}

depends_on = [
aws_iam_role.default,
aws_iam_role_policy_attachment.cluster_elb_service_role,
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ variable "bootstrap_self_managed_addons_enabled" {
default = null
}

variable "zonal_shift_config" {
type = object({
enabled = optional(bool, null)
})
description = "Configuration block with zonal shift configuration for the cluster"
default = null
}

variable "cluster_attributes" {
type = list(string)
description = "Override label module default cluster attributes"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.34.0"
version = ">= 5.74.0"
}
tls = {
source = "hashicorp/tls"
Expand Down