forked from terraform-aws-modules/terraform-aws-eks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
outputs.tf
211 lines (174 loc) · 7.3 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
output "cluster_id" {
description = "The name/id of the EKS cluster. Will block on cluster creation until the cluster is really ready."
value = element(concat(aws_eks_cluster.this.*.id, [""]), 0)
# So that calling plans wait for the cluster to be available before attempting to use it.
# There is no need to duplicate this datasource
depends_on = [data.http.wait_for_cluster]
}
output "cluster_arn" {
description = "The Amazon Resource Name (ARN) of the cluster."
value = element(concat(aws_eks_cluster.this.*.arn, [""]), 0)
}
output "cluster_certificate_authority_data" {
description = "Nested attribute containing certificate-authority-data for your cluster. This is the base64 encoded certificate data required to communicate with your cluster."
value = element(concat(aws_eks_cluster.this[*].certificate_authority[0].data, [""]), 0)
}
output "cluster_endpoint" {
description = "The endpoint for your EKS Kubernetes API."
value = element(concat(aws_eks_cluster.this.*.endpoint, [""]), 0)
}
output "cluster_version" {
description = "The Kubernetes server version for the EKS cluster."
value = element(concat(aws_eks_cluster.this[*].version, [""]), 0)
}
output "cluster_security_group_id" {
description = "Security group ID attached to the EKS cluster. On 1.14 or later, this is the 'Additional security groups' in the EKS console."
value = local.cluster_security_group_id
}
output "config_map_aws_auth" {
description = "A kubernetes configuration to authenticate to this EKS cluster."
value = kubernetes_config_map.aws_auth.*
}
output "cluster_iam_role_name" {
description = "IAM role name of the EKS cluster."
value = local.cluster_iam_role_name
}
output "cluster_iam_role_arn" {
description = "IAM role ARN of the EKS cluster."
value = local.cluster_iam_role_arn
}
output "cluster_oidc_issuer_url" {
description = "The URL on the EKS cluster OIDC Issuer"
value = flatten(concat(aws_eks_cluster.this[*].identity[*].oidc.0.issuer, [""]))[0]
}
output "cluster_primary_security_group_id" {
description = "The cluster primary security group ID created by the EKS cluster on 1.14 or later. Referred to as 'Cluster security group' in the EKS console."
value = local.cluster_primary_security_group_id
}
output "cloudwatch_log_group_name" {
description = "Name of cloudwatch log group created"
value = element(concat(aws_cloudwatch_log_group.this[*].name, [""]), 0)
}
output "cloudwatch_log_group_arn" {
description = "Arn of cloudwatch log group created"
value = element(concat(aws_cloudwatch_log_group.this[*].arn, [""]), 0)
}
output "kubeconfig" {
description = "kubectl config file contents for this EKS cluster. Will block on cluster creation until the cluster is really ready."
value = local.kubeconfig
# So that calling plans wait for the cluster to be available before attempting to use it.
# There is no need to duplicate this datasource
depends_on = [data.http.wait_for_cluster]
}
output "kubeconfig_filename" {
description = "The filename of the generated kubectl config. Will block on cluster creation until the cluster is really ready."
value = concat(local_file.kubeconfig.*.filename, [""])[0]
# So that calling plans wait for the cluster to be available before attempting to use it.
# There is no need to duplicate this datasource
depends_on = [data.http.wait_for_cluster]
}
output "oidc_provider_arn" {
description = "The ARN of the OIDC Provider if `enable_irsa = true`."
value = var.enable_irsa ? concat(aws_iam_openid_connect_provider.oidc_provider[*].arn, [""])[0] : null
}
output "workers_asg_arns" {
description = "IDs of the autoscaling groups containing workers."
value = concat(
aws_autoscaling_group.workers.*.arn,
aws_autoscaling_group.workers_launch_template.*.arn,
)
}
output "workers_asg_names" {
description = "Names of the autoscaling groups containing workers."
value = concat(
aws_autoscaling_group.workers.*.id,
aws_autoscaling_group.workers_launch_template.*.id,
)
}
output "workers_user_data" {
description = "User data of worker groups"
value = concat(
local.userdata_rendered,
local.launch_template_userdata_rendered,
)
}
output "workers_default_ami_id" {
description = "ID of the default worker group AMI"
value = local.default_ami_id_linux
}
output "workers_default_ami_id_windows" {
description = "ID of the default Windows worker group AMI"
value = local.default_ami_id_windows
}
output "workers_launch_template_ids" {
description = "IDs of the worker launch templates."
value = aws_launch_template.workers_launch_template.*.id
}
output "workers_launch_template_arns" {
description = "ARNs of the worker launch templates."
value = aws_launch_template.workers_launch_template.*.arn
}
output "workers_launch_template_latest_versions" {
description = "Latest versions of the worker launch templates."
value = aws_launch_template.workers_launch_template.*.latest_version
}
output "worker_security_group_id" {
description = "Security group ID attached to the EKS workers."
value = local.worker_security_group_id
}
output "worker_iam_instance_profile_arns" {
description = "default IAM instance profile ARN for EKS worker groups"
value = concat(
aws_iam_instance_profile.workers.*.arn,
aws_iam_instance_profile.workers_launch_template.*.arn
)
}
output "worker_iam_instance_profile_names" {
description = "default IAM instance profile name for EKS worker groups"
value = concat(
aws_iam_instance_profile.workers.*.name,
aws_iam_instance_profile.workers_launch_template.*.name
)
}
output "worker_iam_role_name" {
description = "default IAM role name for EKS worker groups"
value = coalescelist(
aws_iam_role.workers.*.name,
data.aws_iam_instance_profile.custom_worker_group_iam_instance_profile.*.role_name,
data.aws_iam_instance_profile.custom_worker_group_launch_template_iam_instance_profile.*.role_name,
[""]
)[0]
}
output "worker_iam_role_arn" {
description = "default IAM role ARN for EKS worker groups"
value = coalescelist(
aws_iam_role.workers.*.arn,
data.aws_iam_instance_profile.custom_worker_group_iam_instance_profile.*.role_arn,
data.aws_iam_instance_profile.custom_worker_group_launch_template_iam_instance_profile.*.role_arn,
[""]
)[0]
}
output "fargate_profile_ids" {
description = "EKS Cluster name and EKS Fargate Profile names separated by a colon (:)."
value = module.fargate.fargate_profile_ids
}
output "fargate_profile_arns" {
description = "Amazon Resource Name (ARN) of the EKS Fargate Profiles."
value = module.fargate.fargate_profile_arns
}
output "fargate_iam_role_name" {
description = "IAM role name for EKS Fargate pods"
value = module.fargate.iam_role_name
}
output "fargate_iam_role_arn" {
description = "IAM role ARN for EKS Fargate pods"
value = module.fargate.iam_role_arn
}
output "node_groups" {
description = "Outputs from EKS node groups. Map of maps, keyed by var.node_groups keys"
value = module.node_groups.node_groups
}
output "security_group_rule_cluster_https_worker_ingress" {
description = "Security group rule responsible for allowing pods to communicate with the EKS cluster API."
value = aws_security_group_rule.cluster_https_worker_ingress
}