mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 00:34:31 +01:00
* Add destroy-time flag * Update changelog Fix cluster count * Fix cluster count * Fix docs * Fix outputs * Fix unsupported attribute on cluster_certificate_authority_data output Co-Authored-By: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com> * Remove unnecessary flatten from cluster_endpoint output Co-Authored-By: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com> * Improve description of var.enabled * Fix errors manifesting when used on an existing-cluster * Update README.md * Renamed destroy-time flag * Revert removal of changelog addition entry * Update flag name in readme * Update flag variable name * Update cluster referencing for consistency * Update flag name to `create_eks` * Fixed incorrect count-based reference to aws_eks_cluster.this (there's only one) * Replaced all incorrect aws_eks_cluster.this[count.index] references (there will be just one, so using '[0]'). * Changelog update, explicitly mentioning flag * Fixed interpolation deprecation warning * Fixed outputs to support conditional cluster * Applied create_eks to aws_auth.tf * Removed unused variable. Updated Changelog. Formatting. * Fixed references to aws_eks_cluster.this[0] that would raise errors when setting create_eks to false whilst having launch templates or launch configurations configured. * Readme and example updates. * Revert "Readme and example updates." This reverts commit 18a0746355e136010ad54858a1b518406f6a3638. * Updated readme section of conditionally creation with provider example. * Added conditions to node_groups. * Fixed reversed map_roles check * Update aws_auth.tf Revert this due to https://github.com/terraform-aws-modules/terraform-aws-eks/pull/611
160 lines
5.2 KiB
HCL
160 lines
5.2 KiB
HCL
output "cluster_id" {
|
|
description = "The name/id of the EKS cluster."
|
|
value = element(concat(aws_eks_cluster.this.*.id, list("")), 0)
|
|
}
|
|
|
|
output "cluster_arn" {
|
|
description = "The Amazon Resource Name (ARN) of the cluster."
|
|
value = element(concat(aws_eks_cluster.this.*.arn, list("")), 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, list("")), 0)
|
|
}
|
|
|
|
output "cluster_endpoint" {
|
|
description = "The endpoint for your EKS Kubernetes API."
|
|
value = element(concat(aws_eks_cluster.this.*.endpoint, list("")), 0)
|
|
}
|
|
|
|
output "cluster_version" {
|
|
description = "The Kubernetes server version for the EKS cluster."
|
|
value = element(concat(aws_eks_cluster.this[*].version, list("")), 0)
|
|
}
|
|
|
|
output "cluster_security_group_id" {
|
|
description = "Security group ID attached to the EKS cluster."
|
|
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 = concat(aws_eks_cluster.this[*].identity[*].oidc.0.issuer, [""])[0]
|
|
}
|
|
|
|
output "cloudwatch_log_group_name" {
|
|
description = "Name of cloudwatch log group created"
|
|
value = aws_cloudwatch_log_group.this[*].name
|
|
}
|
|
|
|
output "kubeconfig" {
|
|
description = "kubectl config file contents for this EKS cluster."
|
|
value = concat(data.template_file.kubeconfig[*].rendered, [""])[0]
|
|
}
|
|
|
|
output "kubeconfig_filename" {
|
|
description = "The filename of the generated kubectl config."
|
|
value = concat(local_file.kubeconfig.*.filename, [""])[0]
|
|
}
|
|
|
|
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(
|
|
data.template_file.userdata.*.rendered,
|
|
data.template_file.launch_template_userdata.*.rendered,
|
|
)
|
|
}
|
|
|
|
output "workers_default_ami_id" {
|
|
description = "ID of the default worker group AMI"
|
|
value = data.aws_ami.eks_worker.id
|
|
}
|
|
|
|
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 "worker_autoscaling_policy_name" {
|
|
description = "Name of the worker autoscaling IAM policy if `manage_worker_autoscaling_policy = true`"
|
|
value = concat(aws_iam_policy.worker_autoscaling[*].name, [""])[0]
|
|
}
|
|
|
|
output "worker_autoscaling_policy_arn" {
|
|
description = "ARN of the worker autoscaling IAM policy if `manage_worker_autoscaling_policy = true`"
|
|
value = concat(aws_iam_policy.worker_autoscaling[*].arn, [""])[0]
|
|
}
|