1+ output "region" {
2+ description = " The AWS region this module resources resides in."
3+ value = aws_eks_cluster. this . region
4+ }
5+
16output "name" {
27 description = " The name of the cluster."
38 value = aws_eks_cluster. this . name
@@ -23,11 +28,47 @@ output "platform_version" {
2328 value = aws_eks_cluster. this . platform_version
2429}
2530
31+ output "upgrade_policy" {
32+ description = " The upgrade policy for the cluster."
33+ value = {
34+ force_upgrade = aws_eks_cluster.this.force_update_version
35+ support_type = aws_eks_cluster.this.upgrade_policy[0 ].support_type
36+ }
37+ }
38+
2639output "status" {
2740 description = " The status of the EKS cluster. One of `CREATING`, `ACTIVE`, `DELETING`, `FAILED`."
2841 value = aws_eks_cluster. this . status
2942}
3043
44+ output "arc_zonal_shift" {
45+ description = " The configurations of ARC zonal shift for the EKS cluster."
46+ value = {
47+ enabled = try (aws_eks_cluster. this . zonal_shift_config [0 ]. enabled , false )
48+ }
49+ }
50+
51+ output "auto_mode" {
52+ description = " The configuration for Auto-mode of the EKS cluster."
53+ value = {
54+ compute = {
55+ enabled = try (aws_eks_cluster. this . compute_config [0 ]. enabled , false )
56+ builtin_node_pools = try (aws_eks_cluster. this . compute_config [0 ]. node_pools , [])
57+ node_role = try (aws_eks_cluster. this . compute_config [0 ]. node_role_arn , null )
58+ }
59+ network = {
60+ elastic_load_balancing = {
61+ enabled = try (aws_eks_cluster. this . kubernetes_network_config [0 ]. elastic_load_balancing [0 ]. enabled , false )
62+ }
63+ }
64+ storage = {
65+ block_storage = {
66+ enabled = try (aws_eks_cluster. this . storage_config [0 ]. block_storage [0 ]. enabled , false )
67+ }
68+ }
69+ }
70+ }
71+
3172output "vpc_id" {
3273 description = " The ID of VPC associated with the cluster."
3374 value = aws_eks_cluster. this . vpc_config [0 ]. vpc_id
@@ -75,15 +116,18 @@ output "outpost_config" {
75116 description = << EOF
76117 The configurations of the outpost for the EKS cluster.
77118 `outposts` - The list of the Outposts ARNs.
78- `control_plane_instance_type` - The EC2 instance type of the local EKS control plane node on Outposts.
79- `control_plane_placement_group` - The name of the placement group for the EKS control plane node on Outposts.
119+ `control_plane` - The configurations of the local EKS control plane node on Outposts.
120+ `instance_type` - The EC2 instance type of the local EKS control plane node on Outposts.
121+ `placement_group` - The name of the placement group for the EKS control plane node on Outposts.
80122 EOF
81123 value = (var. outpost_config != null
82124 ? {
83- outposts = aws_eks_cluster.this.outpost_config[0 ].outpost_arns
84- cluster_id = aws_eks_cluster.this.cluster_id
85- control_plane_instance_type = aws_eks_cluster.this.outpost_config[0 ].control_plane_instance_type
86- control_plane_placement_group = one (aws_eks_cluster. this . outpost_config [0 ]. control_plane_placement [* ]. group_name )
125+ outposts = aws_eks_cluster.this.outpost_config[0 ].outpost_arns
126+ cluster_id = aws_eks_cluster.this.cluster_id
127+ control_plane = {
128+ instance_type = aws_eks_cluster.this.outpost_config[0 ].control_plane_instance_type
129+ placement_group = one (aws_eks_cluster. this . outpost_config [0 ]. control_plane_placement [* ]. group_name )
130+ }
87131 }
88132 : null
89133 )
@@ -103,6 +147,18 @@ output "kubernetes_network_config" {
103147 }
104148}
105149
150+ output "remote_network_config" {
151+ description = << EOF
152+ The configurations of remote network for the EKS Hybrid nodes.
153+ `node_ipv4_cidrs` - A set of IPv4 CIDR blocks for remote nodes.
154+ `pod_ipv4_cidrs` - A set of IPv4 CIDR blocks for remote pods.
155+ EOF
156+ value = {
157+ node_ipv4_cidrs = try (aws_eks_cluster. this . remote_network_config [0 ]. remote_node_networks [0 ]. cidrs , [])
158+ pod_ipv4_cidrs = try (aws_eks_cluster. this . remote_network_config [0 ]. remote_pod_networks [0 ]. cidrs , [])
159+ }
160+ }
161+
106162output "authentication_mode" {
107163 description = " The authentication mode for the cluster."
108164 value = aws_eks_cluster. this . access_config [0 ]. authentication_mode
@@ -141,27 +197,33 @@ output "default_node_role" {
141197output "irsa_oidc_provider" {
142198 description = << EOF
143199 The configurations of the OIDC provider for IRSA (IAM Roles for Service Accounts).
200+ `enabled` - Whether to create the IAM OIDC provider for the EKS cluster to use IAM Roles for Service Accounts (IRSA).
144201 `arn` - The ARN assigned by AWS for this provider.
145202 `url` - The URL of the identity provider.
146203 `urn` - The URN of the identity provider.
147204 `audiences` - A list of audiences (also known as client IDs) for the IAM OIDC provider.
148205 EOF
149206 value = {
150- arn = module.oidc_provider.arn
207+ enabled = var.irsa_oidc_provider.enabled
151208 url = aws_eks_cluster.this.identity[0 ].oidc[0 ].issuer
152- urn = module.oidc_provider.urn
153- audiences = module.oidc_provider.audiences
209+ arn = one (module. oidc_provider [* ]. arn )
210+ urn = one (module. oidc_provider [* ]. urn )
211+ audiences = one (module. oidc_provider [* ]. audiences )
154212 }
155213}
156214
157215output "logging" {
158216 description = " The configurations of the control plane logging."
159217 value = {
218+ enabled = var.logging.enabled
160219 log_types = aws_eks_cluster.this.enabled_cluster_log_types
161- cloudwatch_log_group = {
162- arn = data.aws_cloudwatch_log_group.this.arn
163- name = data.aws_cloudwatch_log_group.this.name
164- }
220+ cloudwatch_log_group = (var.logging.enabled
221+ ? {
222+ arn = data.aws_cloudwatch_log_group.this[0 ].arn
223+ name = data.aws_cloudwatch_log_group.this[0 ].name
224+ }
225+ : null
226+ )
165227 }
166228}
167229
@@ -190,14 +252,6 @@ output "created_at" {
190252 value = aws_eks_cluster. this . created_at
191253}
192254
193- # output "debug" {
194- # value = {
195- # for k, v in aws_eks_cluster.this :
196- # k => v
197- # if !contains(["arn", "access_config", "certificate_authority", "tags", "tags_all", "created_at", "role_arn", "name", "status", "version", "timeouts", "platform_version", "kubernetes_network_config", "id", "endpoint", "encryption_config", "outpost_config", "identity", "vpc_config", "enabled_cluster_log_types", "cluster_id"], k)
198- # }
199- # }
200-
201255output "resource_group" {
202256 description = " The resource group created to manage resources in this module."
203257 value = merge (
@@ -213,3 +267,11 @@ output "resource_group" {
213267 )
214268 )
215269}
270+
271+ # output "debug" {
272+ # value = {
273+ # for k, v in aws_eks_cluster.this :
274+ # k => v
275+ # if !contains(["arn", "access_config", "certificate_authority", "tags", "tags_all", "created_at", "role_arn", "name", "status", "version", "timeouts", "platform_version", "kubernetes_network_config", "id", "endpoint", "encryption_config", "outpost_config", "identity", "vpc_config", "enabled_cluster_log_types", "cluster_id", "deletion_protection", "region", "upgrade_policy", "force_update_version", "oidc", "remote_network_config", "bootstrap_self_managed_addons", "storage_config", "compute_config", "zonal_shift_config"], k)
276+ # }
277+ # }
0 commit comments