Skip to content

Commit e12ab7a

Browse files
authored
feat: Add support for upgrade_policy (#3112)
* feat: Add support for `upgrade_policy` * chore: Update test and validate
1 parent 705eb80 commit e12ab7a

File tree

27 files changed

+55
-36
lines changed

27 files changed

+55
-36
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.92.0
3+
rev: v1.92.1
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
176176
| Name | Version |
177177
|------|---------|
178178
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
179-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.58 |
179+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
180180
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9 |
181181
| <a name="requirement_tls"></a> [tls](#requirement\_tls) | >= 3.0 |
182182

183183
## Providers
184184

185185
| Name | Version |
186186
|------|---------|
187-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.58 |
187+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
188188
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.9 |
189189
| <a name="provider_tls"></a> [tls](#provider\_tls) | >= 3.0 |
190190

@@ -267,6 +267,7 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
267267
| <a name="input_cluster_service_ipv6_cidr"></a> [cluster\_service\_ipv6\_cidr](#input\_cluster\_service\_ipv6\_cidr) | The CIDR block to assign Kubernetes pod and service IP addresses from if `ipv6` was specified when the cluster was created. Kubernetes assigns service addresses from the unique local address range (fc00::/7) because you can't specify a custom IPv6 CIDR block when you create the cluster | `string` | `null` | no |
268268
| <a name="input_cluster_tags"></a> [cluster\_tags](#input\_cluster\_tags) | A map of additional tags to add to the cluster | `map(string)` | `{}` | no |
269269
| <a name="input_cluster_timeouts"></a> [cluster\_timeouts](#input\_cluster\_timeouts) | Create, update, and delete timeout configurations for the cluster | `map(string)` | `{}` | no |
270+
| <a name="input_cluster_upgrade_policy"></a> [cluster\_upgrade\_policy](#input\_cluster\_upgrade\_policy) | Configuration block for the cluster upgrade policy | `any` | `{}` | no |
270271
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Kubernetes `<major>.<minor>` version to use for the EKS cluster (i.e.: `1.27`) | `string` | `null` | no |
271272
| <a name="input_control_plane_subnet_ids"></a> [control\_plane\_subnet\_ids](#input\_control\_plane\_subnet\_ids) | A list of subnet IDs where the EKS cluster control plane (ENIs) will be provisioned. Used for expanding the pool of subnets used by nodes/node groups without replacing the EKS control plane | `list(string)` | `[]` | no |
272273
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no |

examples/eks-managed-node-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.58"
7+
version = ">= 5.61"
88
}
99
}
1010
}

examples/karpenter/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ Note that this example may create resources which cost money. Run `terraform des
8989
| Name | Version |
9090
|------|---------|
9191
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
92-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.58 |
92+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
9393
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.7 |
9494
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 2.0 |
9595

9696
## Providers
9797

9898
| Name | Version |
9999
|------|---------|
100-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.58 |
101-
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 5.58 |
100+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
101+
| <a name="provider_aws.virginia"></a> [aws.virginia](#provider\_aws.virginia) | >= 5.61 |
102102
| <a name="provider_helm"></a> [helm](#provider\_helm) | >= 2.7 |
103103
| <a name="provider_kubectl"></a> [kubectl](#provider\_kubectl) | >= 2.0 |
104104

examples/karpenter/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.58"
7+
version = ">= 5.61"
88
}
99
helm = {
1010
source = "hashicorp/helm"

examples/outposts/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ terraform destroy --auto-approve
4646
| Name | Version |
4747
|------|---------|
4848
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
49-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.58 |
49+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.61 |
5050
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.20 |
5151

5252
## Providers
5353

5454
| Name | Version |
5555
|------|---------|
56-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.58 |
56+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.61 |
5757
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.20 |
5858

5959
## Modules

examples/outposts/prerequisites/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.58"
7+
version = ">= 5.61"
88
}
99
}
1010
}

examples/outposts/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.58"
7+
version = ">= 5.61"
88
}
99
kubernetes = {
1010
source = "hashicorp/kubernetes"

examples/self-managed-node-group/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.58"
7+
version = ">= 5.61"
88
}
99
}
1010
}

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ resource "aws_eks_cluster" "this" {
8484
}
8585
}
8686

87+
dynamic "upgrade_policy" {
88+
for_each = length(var.cluster_upgrade_policy) > 0 ? [var.cluster_upgrade_policy] : []
89+
90+
content {
91+
support_type = try(upgrade_policy.value.support_type, null)
92+
}
93+
}
94+
8795
tags = merge(
8896
{ terraform-aws-modules = "eks" },
8997
var.tags,

0 commit comments

Comments
 (0)