Skip to content

Commit 43b2f77

Browse files
authored
Add support for upgrade policy configuration (#245)
1 parent cf32252 commit 43b2f77

File tree

7 files changed

+30
-0
lines changed

7 files changed

+30
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ Available targets:
454454
| <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 |
455455
| <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 |
456456
| <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 |
457+
| <a name="input_upgrade_policy"></a> [upgrade\_policy](#input\_upgrade\_policy) | Configuration block for the support policy to use for the cluster | <pre>object({<br/> support_type = optional(string, null)<br/> })</pre> | `null` | no |
457458
| <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 |
458459

459460
## Outputs

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
| <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 |
110110
| <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 |
111111
| <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 |
112+
| <a name="input_upgrade_policy"></a> [upgrade\_policy](#input\_upgrade\_policy) | Configuration block for the support policy to use for the cluster | <pre>object({<br/> support_type = optional(string, null)<br/> })</pre> | `null` | no |
112113
| <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 |
113114

114115
## Outputs

examples/complete/fixtures.us-east-2.tfvars

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ addons = [
5050
},
5151
]
5252

53+
upgrade_policy = {
54+
support_type = "STANDARD"
55+
}
56+
5357
zonal_shift_config = {
5458
enabled = true
5559
}

examples/complete/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ module "eks_cluster" {
113113
addons = local.addons
114114
addons_depends_on = [module.eks_node_group]
115115
bootstrap_self_managed_addons_enabled = var.bootstrap_self_managed_addons_enabled
116+
upgrade_policy = var.upgrade_policy
116117
zonal_shift_config = var.zonal_shift_config
117118

118119
access_entry_map = local.access_entry_map

examples/complete/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ variable "bootstrap_self_managed_addons_enabled" {
115115
default = null
116116
}
117117

118+
variable "upgrade_policy" {
119+
type = object({
120+
support_type = optional(string, null)
121+
})
122+
description = "Configuration block for the support policy to use for the cluster"
123+
default = null
124+
}
125+
118126
variable "zonal_shift_config" {
119127
type = object({
120128
enabled = optional(bool, null)

main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ resource "aws_eks_cluster" "default" {
110110
}
111111
}
112112

113+
dynamic "upgrade_policy" {
114+
for_each = var.upgrade_policy != null ? [var.upgrade_policy] : []
115+
content {
116+
support_type = upgrade_policy.value.support_type
117+
}
118+
}
119+
113120
dynamic "zonal_shift_config" {
114121
for_each = var.zonal_shift_config != null ? [var.zonal_shift_config] : []
115122
content {

variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ variable "bootstrap_self_managed_addons_enabled" {
203203
default = null
204204
}
205205

206+
variable "upgrade_policy" {
207+
type = object({
208+
support_type = optional(string, null)
209+
})
210+
description = "Configuration block for the support policy to use for the cluster"
211+
default = null
212+
}
213+
206214
variable "zonal_shift_config" {
207215
type = object({
208216
enabled = optional(bool, null)

0 commit comments

Comments
 (0)