-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
120 lines (93 loc) · 4.05 KB
/
Copy pathoutputs.tf
File metadata and controls
120 lines (93 loc) · 4.05 KB
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
# Output value definitions for AgentGuard Infrastructure
# Outputs expose essential information for cluster access and operational use
# ============================================================================
# Infrastructure Outputs
# ============================================================================
output "cluster_endpoint" {
description = "EKS cluster API endpoint for kubectl access"
value = module.eks.cluster_endpoint
}
output "cluster_name" {
description = "EKS cluster name for reference and configuration"
value = module.eks.cluster_id
}
output "cluster_ca_certificate" {
description = "Base64-encoded CA certificate for cluster authentication"
value = module.eks.cluster_ca_certificate
sensitive = true
}
output "vpc_id" {
description = "VPC identifier for network reference"
value = module.vpc.vpc_id
}
output "public_subnet_ids" {
description = "List of public subnet IDs where nodes are deployed"
value = module.vpc.public_subnet_ids
}
output "node_group_id" {
description = "EKS node group identifier for management operations"
value = module.node_group.node_group_id
}
output "node_group_status" {
description = "Current status of the EKS node group"
value = module.node_group.node_group_status
}
# ============================================================================
# Operational Outputs
# ============================================================================
output "loadbalancer_endpoint" {
description = "External LoadBalancer endpoint for validation service (may take a few minutes to provision)"
value = try(kubernetes_service.validation.status[0].load_balancer[0].ingress[0].hostname, "pending")
}
output "kubeconfig_command" {
description = "AWS CLI command to configure kubectl access to the cluster"
value = "aws eks update-kubeconfig --region ${var.region} --name ${module.eks.cluster_id}"
}
output "region" {
description = "AWS region where infrastructure is deployed"
value = var.region
}
output "cluster_version" {
description = "Kubernetes version running on the EKS cluster"
value = module.eks.cluster_version
}
# ============================================================================
# Security Group Outputs
# ============================================================================
output "cluster_security_group_id" {
description = "Security group ID attached to the EKS cluster (AWS-managed)"
value = module.eks.cluster_security_group_id
}
output "cluster_oidc_issuer_arn" {
description = "ARN of the OIDC Provider for the EKS cluster (for IRSA)"
value = module.eks.cluster_oidc_issuer_arn
}
output "cluster_oidc_issuer" {
description = "OIDC Identity issuer for the cluster without https:// prefix (for IRSA)"
value = module.eks.cluster_oidc_issuer
}
output "node_role_arn" {
description = "IAM role ARN for worker nodes"
value = module.node_group.node_role_arn
}
# ============================================================================
# Validation Instructions
# ============================================================================
output "validation_instructions" {
description = "Instructions for validating the cluster deployment"
value = <<-EOT
Cluster Validation Steps:
========================
1. Configure kubectl:
${format("aws eks update-kubeconfig --region %s --name %s", var.region, module.eks.cluster_id)}
2. Verify nodes are ready:
kubectl get nodes
3. Check validation deployment:
kubectl get deployment nginx-validation
4. Check LoadBalancer service:
kubectl get service nginx-validation-lb
5. Test LoadBalancer endpoint (wait 2-3 minutes for provisioning):
curl http://${try(kubernetes_service.validation.status[0].load_balancer[0].ingress[0].hostname, "PENDING")}
Expected: HTTP 200 response with nginx welcome page
EOT
}