Skip to content

Commit 955db75

Browse files
authored
Merge branch 'main' into feat/cluster-logging
2 parents 3e03cea + 02353e1 commit 955db75

File tree

3 files changed

+110
-2
lines changed

3 files changed

+110
-2
lines changed

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77
}
88
}
99
}
10-
data "aws_partition" "current" {}
10+
data "aws_partition" "current" {} # Used for GovCloud/China partition-aware ARN construction
1111

1212
locals {
1313
is_arm = can(regex("[a-zA-Z]+\\d+g[a-z]*\\..+", var.stack_pelotech_nat_instance_type))
@@ -160,9 +160,10 @@ module "eks" {
160160
# TODO: resume usage of node security group; see: https://linear.app/pelotech/issue/PEL-97
161161
create_node_security_group = false
162162
endpoint_private_access = true
163-
endpoint_public_access = true
163+
endpoint_public_access = var.cluster_endpoint_public_access
164164
enabled_log_types = var.cluster_enabled_log_types
165165

166+
166167
vpc_id = var.stack_existing_vpc_config != null ? var.stack_existing_vpc_config.vpc_id : module.vpc.vpc_id
167168
subnet_ids = var.stack_existing_vpc_config != null ? var.stack_existing_vpc_config.subnet_ids : module.vpc.private_subnets
168169
create_kms_key = var.stack_enable_cluster_kms

outputs.tf

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,105 @@ output "vpc" {
2222
description = "The vpc object when it's created"
2323
value = module.vpc
2424
}
25+
################################################################################
26+
# EKS Cluster
27+
################################################################################
28+
output "eks_cluster_name" {
29+
description = "The name of the EKS cluster"
30+
value = module.eks.cluster_name
31+
}
32+
33+
output "eks_cluster_iam_role_name" {
34+
description = "The name of the EKS cluster IAM role"
35+
value = module.eks.cluster_iam_role_name
36+
}
37+
38+
output "eks_cluster_endpoint" {
39+
description = "The endpoint for the EKS cluster API server"
40+
value = module.eks.cluster_endpoint
41+
}
42+
43+
output "eks_cluster_certificate_authority_data" {
44+
description = "Base64 encoded certificate data for the cluster"
45+
value = module.eks.cluster_certificate_authority_data
46+
}
47+
48+
################################################################################
49+
# Node Groups
50+
################################################################################
51+
output "eks_managed_node_groups" {
52+
description = "Map of attribute maps for all EKS managed node groups created"
53+
value = module.eks.eks_managed_node_groups
54+
}
55+
56+
output "eks_managed_node_groups_autoscaling_group_names" {
57+
description = "List of the autoscaling group names created by EKS managed node groups"
58+
value = module.eks.eks_managed_node_groups_autoscaling_group_names
59+
}
60+
61+
################################################################################
62+
# Security Groups
63+
################################################################################
64+
output "cluster_security_group_id" {
65+
description = "Cluster security group that was created by Amazon EKS for the cluster"
66+
value = module.eks.cluster_security_group_id
67+
}
68+
69+
output "node_security_group_id" {
70+
description = "ID of the node shared security group"
71+
value = module.eks.node_security_group_id
72+
}
73+
74+
################################################################################
75+
# KMS
76+
################################################################################
77+
output "kms_key_arn" {
78+
description = "The Amazon Resource Name (ARN) of the KMS key"
79+
value = module.eks.kms_key_arn
80+
}
81+
82+
################################################################################
83+
# Karpenter
84+
################################################################################
85+
output "karpenter_node_iam_role_name" {
86+
description = "The name of the Karpenter node IAM role"
87+
value = try(module.karpenter[0].node_iam_role_name, null)
88+
}
89+
90+
output "karpenter_queue_name" {
91+
description = "The name of the Karpenter SQS queue"
92+
value = try(module.karpenter[0].queue_name, null)
93+
}
94+
95+
################################################################################
96+
# IRSA Role ARNs
97+
################################################################################
98+
output "load_balancer_controller_role_arn" {
99+
description = "ARN of the ALB controller IRSA role"
100+
value = module.load_balancer_controller_irsa_role.arn
101+
}
102+
103+
output "ebs_csi_driver_role_arn" {
104+
description = "ARN of the EBS CSI driver IRSA role"
105+
value = module.ebs_csi_driver_irsa_role.arn
106+
}
107+
108+
output "s3_csi_driver_role_arn" {
109+
description = "ARN of the S3 CSI driver IRSA role"
110+
value = try(module.s3_driver_irsa_role[0].arn, null)
111+
}
112+
113+
output "external_dns_role_arn" {
114+
description = "ARN of the External DNS IRSA role"
115+
value = try(module.external_dns_irsa_role[0].arn, null)
116+
}
117+
118+
output "cert_manager_role_arn" {
119+
description = "ARN of the Cert Manager IRSA role"
120+
value = try(module.cert_manager_irsa_role[0].arn, null)
121+
}
122+
123+
output "karpenter_role_arn" {
124+
description = "ARN of the Karpenter IRSA role"
125+
value = try(module.karpenter[0].iam_role_arn, null)
126+
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,8 @@ variable "cluster_enabled_log_types" {
198198
default = []
199199
description = "List of EKS control plane log types to enable. Valid values: api, audit, authenticator, controllerManager, scheduler."
200200
}
201+
variable "cluster_endpoint_public_access" {
202+
type = bool
203+
default = true
204+
description = "Whether the EKS cluster API server endpoint is publicly accessible. Set to false for private-only access (requires VPC connectivity)."
205+
}

0 commit comments

Comments
 (0)