Skip to content

Commit 832ec34

Browse files
committed
Provides accurate type constraint for cluster_compute_config
1 parent 1bfc10a commit 832ec34

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ We are grateful to the community for contributing bugfixes and improvements! Ple
393393
| <a name="input_cluster_additional_security_group_ids"></a> [cluster\_additional\_security\_group\_ids](#input\_cluster\_additional\_security\_group\_ids) | List of additional, externally created security group IDs to attach to the cluster control plane | `list(string)` | `[]` | no |
394394
| <a name="input_cluster_addons"></a> [cluster\_addons](#input\_cluster\_addons) | Map of cluster addon configurations to enable for the cluster. Addon name can be the map keys or set with `name` | `any` | `{}` | no |
395395
| <a name="input_cluster_addons_timeouts"></a> [cluster\_addons\_timeouts](#input\_cluster\_addons\_timeouts) | Create, update, and delete timeout configurations for the cluster addons | `map(string)` | `{}` | no |
396-
| <a name="input_cluster_compute_config"></a> [cluster\_compute\_config](#input\_cluster\_compute\_config) | Configuration block for the cluster compute configuration | `any` | `{}` | no |
396+
| <a name="input_cluster_compute_config"></a> [cluster\_compute\_config](#input\_cluster\_compute\_config) | Configuration block for the cluster compute configuration | <pre>object({<br/> enabled = bool<br/> node_pools = optional(list(string), [])<br/> node_role_arn = optional(string)<br/> })</pre> | `null` | no |
397397
| <a name="input_cluster_enabled_log_types"></a> [cluster\_enabled\_log\_types](#input\_cluster\_enabled\_log\_types) | A list of the desired control plane logs to enable. For more information, see Amazon EKS Control Plane Logging documentation (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) | `list(string)` | <pre>[<br/> "audit",<br/> "api",<br/> "authenticator"<br/>]</pre> | no |
398398
| <a name="input_cluster_encryption_config"></a> [cluster\_encryption\_config](#input\_cluster\_encryption\_config) | Configuration block with encryption configuration for the cluster. To disable secret encryption, set this value to `{}` | `any` | <pre>{<br/> "resources": [<br/> "secrets"<br/> ]<br/>}</pre> | no |
399399
| <a name="input_cluster_encryption_policy_description"></a> [cluster\_encryption\_policy\_description](#input\_cluster\_encryption\_policy\_description) | Description of the cluster encryption policy created | `string` | `"Cluster encryption policy to allow cluster role to utilize CMK provided"` | no |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "aws_eks_cluster" "this" {
5353
}
5454

5555
dynamic "compute_config" {
56-
for_each = length(var.cluster_compute_config) > 0 ? [var.cluster_compute_config] : []
56+
for_each = var.cluster_compute_config[*]
5757

5858
content {
5959
enabled = local.auto_mode_enabled

variables.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ variable "authentication_mode" {
4646

4747
variable "cluster_compute_config" {
4848
description = "Configuration block for the cluster compute configuration"
49-
type = any
50-
default = {}
49+
type = object({
50+
enabled = bool
51+
node_pools = optional(list(string), [])
52+
node_role_arn = optional(string)
53+
})
54+
default = null
5155
}
5256

5357
variable "cluster_upgrade_policy" {

0 commit comments

Comments
 (0)