1
0
mirror of https://github.com/terraform-aws-modules/terraform-aws-eks.git synced 2025-09-09 19:32:58 +08:00

fix: Correct access policy logic to support not providing a policy to associate (#3464)

This commit is contained in:
Bryant Biggs
2025-08-02 07:55:57 -05:00
committed by GitHub
parent b745952ac8
commit 39be61d702
4 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -381,7 +381,7 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
+1 -1
View File
@@ -269,7 +269,7 @@ locals {
# associations within a single entry
flattened_access_entries = flatten([
for entry_key, entry_val in local.merged_access_entries : [
for pol_key, pol_val in try(entry_val.policy_associations, {}) :
for pol_key, pol_val in entry_val.policy_associations :
merge(
{
principal_arn = entry_val.principal_arn
+6
View File
@@ -408,6 +408,12 @@ module "eks" {
}
}
}
no-policy = {
kubernetes_groups = ["something"]
principal_arn = data.aws_caller_identity.current.arn
user_name = "someone"
}
}
tags = local.tags
+1 -1
View File
@@ -218,7 +218,7 @@ variable "access_entries" {
namespaces = optional(list(string))
type = string
})
})))
})), {})
}))
default = {}
}