output "id" {
  description = "EKS cluster name (ID)"
  value       = aws_eks_cluster.this.id
}

output "arn" {
  description = "EKS cluster ARN"
  value       = aws_eks_cluster.this.arn
}

output "endpoint" {
  description = "Kubernetes API server endpoint"
  value       = aws_eks_cluster.this.endpoint
}

output "certificate_authority" {
  description = "Base64-encoded cluster CA certificate"
  value       = aws_eks_cluster.this.certificate_authority[0].data
}

output "oidc_issuer_url" {
  description = "OIDC issuer URL for IRSA (without https://)"
  value       = aws_eks_cluster.this.identity[0].oidc[0].issuer
}

output "cluster_security_group_id" {
  description = "Cluster security group ID created by EKS"
  value       = aws_eks_cluster.this.vpc_config[0].cluster_security_group_id
}

output "cluster_role_arn" {
  description = "ARN of the cluster IAM role"
  value       = aws_iam_role.cluster.arn
}

output "addon_ids" {
  description = "Map of add-on name to add-on ID"
  value       = { for k, v in aws_eks_addon.this : k => v.id }
}
