Skip to content

Commit 4074f8c

Browse files
authored
Merge pull request #28 from datafold/gerard-p-2840-deploy-to-staging-and-saas
fix: Add outputs to automate flow more
2 parents 22c4bbc + 5c4d810 commit 4074f8c

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

modules/eks/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ output "cluster_scaler_role_arn" {
1212

1313
output "control_plane_security_group_id" {
1414
value = module.eks.cluster_security_group_id
15+
}
16+
17+
output "cluster_endpoint" {
18+
value = module.eks.cluster_endpoint
1519
}

modules/private_access/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ resource "aws_security_group_rule" "nlb_ingress" {
3131
description = "Allows traffic from NLB to CP"
3232
}
3333

34+
data "aws_subnet" "private_access_az" {
35+
id = var.vpc_private_subnets[0]
36+
}
37+
3438
# This internal NLB connects to the control plane
3539
module "nlb" {
3640
source = "terraform-aws-modules/alb/aws"
@@ -66,10 +70,6 @@ module "nlb" {
6670
tags = var.tags
6771
}
6872

69-
#data "dns_a_record_set" "nlb" {
70-
# host = module.nlb.lb_dns_name
71-
#}
72-
7373
resource "aws_vpc_endpoint_service" "pl_control_plane" {
7474
acceptance_required = true
7575
network_load_balancer_arns = [module.nlb.lb_arn]

modules/private_access/outputs.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
output "private_vpces_name" {
2+
value = aws_vpc_endpoint_service.pl_control_plane.service_name
3+
}
4+
5+
output "private_access_az" {
6+
value = data.aws_subnet.private_access_az.availability_zone_id
7+
}

outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ output "cluster_scaler_role_arn" {
7878
description = "The ARN of the role that is able to scale the EKS cluster nodes."
7979
}
8080

81+
output "cluster_endpoint" {
82+
value = module.eks.cluster_endpoint
83+
description = "The URL to the EKS cluster endpoint"
84+
}
85+
8186
output "vpc_cidr" {
8287
value = module.networking.vpc_cidr
8388
description = "The CIDR of the entire VPC"
@@ -133,6 +138,11 @@ output "clickhouse_secret_key" {
133138
description = "The secret key of the IAM user doing the clickhouse backups."
134139
}
135140

141+
output "private_access_vpces_name" {
142+
value = coalesce(one(module.private_access[*].private_vpces_name), "")
143+
description = "Name of the VPCE service that allows private access to the cluster endpoint"
144+
}
145+
136146
output "redis_data_size" {
137147
value = var.redis_data_size
138148
description = "The size in GB of the Redis data volume."
@@ -142,3 +152,8 @@ output "redis_data_volume_id" {
142152
value = resource.aws_ebs_volume.redis_data.id
143153
description = "The EBS volume ID of the Redis data volume."
144154
}
155+
156+
output "vpces_azs" {
157+
value = coalesce(one(module.private_access[*].private_access_az), "")
158+
description = "Set of availability zones where the VPCES is available."
159+
}

0 commit comments

Comments
 (0)