Skip to content

Commit b236208

Browse files
authored
fix: Correct addon timeout lookup/override logic to support global and addon specific settings (#3492)
1 parent b02727a commit b236208

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
384384
|------|-------------|------|---------|:--------:|
385385
| <a name="input_access_entries"></a> [access\_entries](#input\_access\_entries) | Map of access entries to add to the cluster | <pre>map(object({<br/> # Access entry<br/> kubernetes_groups = optional(list(string))<br/> principal_arn = string<br/> type = optional(string, "STANDARD")<br/> user_name = optional(string)<br/> tags = optional(map(string), {})<br/> # Access policy association<br/> policy_associations = optional(map(object({<br/> policy_arn = string<br/> access_scope = object({<br/> namespaces = optional(list(string))<br/> type = string<br/> })<br/> })), {})<br/> }))</pre> | `{}` | no |
386386
| <a name="input_additional_security_group_ids"></a> [additional\_security\_group\_ids](#input\_additional\_security\_group\_ids) | List of additional, externally created security group IDs to attach to the cluster control plane | `list(string)` | `[]` | no |
387-
| <a name="input_addons"></a> [addons](#input\_addons) | Map of cluster addon configurations to enable for the cluster. Addon name can be the map keys or set with `name` | <pre>map(object({<br/> name = optional(string) # will fall back to map key<br/> before_compute = optional(bool, false)<br/> most_recent = optional(bool, true)<br/> addon_version = optional(string)<br/> configuration_values = optional(string)<br/> pod_identity_association = optional(list(object({<br/> role_arn = string<br/> service_account = string<br/> })))<br/> preserve = optional(bool, true)<br/> resolve_conflicts_on_create = optional(string, "NONE")<br/> resolve_conflicts_on_update = optional(string, "OVERWRITE")<br/> service_account_role_arn = optional(string)<br/> timeouts = optional(object({<br/> create = optional(string)<br/> update = optional(string)<br/> delete = optional(string)<br/> }))<br/> tags = optional(map(string), {})<br/> }))</pre> | `null` | no |
388-
| <a name="input_addons_timeouts"></a> [addons\_timeouts](#input\_addons\_timeouts) | Create, update, and delete timeout configurations for the cluster addons | <pre>object({<br/> create = optional(string)<br/> update = optional(string)<br/> delete = optional(string)<br/> })</pre> | `null` | no |
387+
| <a name="input_addons"></a> [addons](#input\_addons) | Map of cluster addon configurations to enable for the cluster. Addon name can be the map keys or set with `name` | <pre>map(object({<br/> name = optional(string) # will fall back to map key<br/> before_compute = optional(bool, false)<br/> most_recent = optional(bool, true)<br/> addon_version = optional(string)<br/> configuration_values = optional(string)<br/> pod_identity_association = optional(list(object({<br/> role_arn = string<br/> service_account = string<br/> })))<br/> preserve = optional(bool, true)<br/> resolve_conflicts_on_create = optional(string, "NONE")<br/> resolve_conflicts_on_update = optional(string, "OVERWRITE")<br/> service_account_role_arn = optional(string)<br/> timeouts = optional(object({<br/> create = optional(string)<br/> update = optional(string)<br/> delete = optional(string)<br/> }), {})<br/> tags = optional(map(string), {})<br/> }))</pre> | `null` | no |
388+
| <a name="input_addons_timeouts"></a> [addons\_timeouts](#input\_addons\_timeouts) | Create, update, and delete timeout configurations for the cluster addons | <pre>object({<br/> create = optional(string)<br/> update = optional(string)<br/> delete = optional(string)<br/> })</pre> | `{}` | no |
389389
| <a name="input_attach_encryption_policy"></a> [attach\_encryption\_policy](#input\_attach\_encryption\_policy) | Indicates whether or not to attach an additional policy for the cluster IAM role to utilize the encryption key provided | `bool` | `true` | no |
390390
| <a name="input_authentication_mode"></a> [authentication\_mode](#input\_authentication\_mode) | The authentication mode for the cluster. Valid values are `CONFIG_MAP`, `API` or `API_AND_CONFIG_MAP` | `string` | `"API_AND_CONFIG_MAP"` | no |
391391
| <a name="input_cloudwatch_log_group_class"></a> [cloudwatch\_log\_group\_class](#input\_cloudwatch\_log\_group\_class) | Specified the log class of the log group. Possible values are: `STANDARD` or `INFREQUENT_ACCESS` | `string` | `null` | no |

main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,9 @@ resource "aws_eks_addon" "this" {
785785
service_account_role_arn = each.value.service_account_role_arn
786786

787787
timeouts {
788-
create = try(coalesce(each.value.timeouts.create, var.addons_timeouts.create), null)
789-
update = try(coalesce(each.value.timeouts.update, var.addons_timeouts.update), null)
790-
delete = try(coalesce(each.value.timeouts.delete, var.addons_timeouts.delete), null)
788+
create = each.value.timeouts.create != null ? each.value.timeouts.create : var.addons_timeouts.create
789+
update = each.value.timeouts.update != null ? each.value.timeouts.update : var.addons_timeouts.update
790+
delete = each.value.timeouts.delete != null ? each.value.timeouts.delete : var.addons_timeouts.delete
791791
}
792792

793793
tags = merge(
@@ -830,9 +830,9 @@ resource "aws_eks_addon" "before_compute" {
830830
service_account_role_arn = each.value.service_account_role_arn
831831

832832
timeouts {
833-
create = try(coalesce(each.value.timeouts.create, var.addons_timeouts.create), null)
834-
update = try(coalesce(each.value.timeouts.update, var.addons_timeouts.update), null)
835-
delete = try(coalesce(each.value.timeouts.delete, var.addons_timeouts.delete), null)
833+
create = each.value.timeouts.create != null ? each.value.timeouts.create : var.addons_timeouts.create
834+
update = each.value.timeouts.update != null ? each.value.timeouts.update : var.addons_timeouts.update
835+
delete = each.value.timeouts.delete != null ? each.value.timeouts.delete : var.addons_timeouts.delete
836836
}
837837

838838
tags = merge(

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ variable "addons" {
635635
create = optional(string)
636636
update = optional(string)
637637
delete = optional(string)
638-
}))
638+
}), {})
639639
tags = optional(map(string), {})
640640
}))
641641
default = null
@@ -648,7 +648,7 @@ variable "addons_timeouts" {
648648
update = optional(string)
649649
delete = optional(string)
650650
})
651-
default = null
651+
default = {}
652652
}
653653

654654
################################################################################

0 commit comments

Comments
 (0)