Skip to content

Commit f76d7a2

Browse files
feat: set loadbalancer_hosted_zone
1 parent 05e9d66 commit f76d7a2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

modules/base/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Module that provides the reference architecture.
4343
| [humanitec_resource_definition_criteria.k8s_logging](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
4444
| [humanitec_resource_definition_criteria.k8s_namespace](https://registry.terraform.io/providers/humanitec/humanitec/latest/docs/resources/resource_definition_criteria) | resource |
4545
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
46+
| [aws_elb_hosted_zone_id.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elb_hosted_zone_id) | data source |
4647
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
4748
| [kubernetes_service.ingress_nginx_controller](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service) | data source |
4849

modules/base/humanitec.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ locals {
44
ingress_address = data.kubernetes_service.ingress_nginx_controller.status.0.load_balancer.0.ingress.0.hostname
55
}
66

7+
data "aws_elb_hosted_zone_id" "main" {}
8+
79
resource "humanitec_resource_definition" "k8s_cluster_driver" {
810
driver_type = "humanitec/k8s-cluster-eks"
911
id = var.cluster_name
@@ -12,9 +14,10 @@ resource "humanitec_resource_definition" "k8s_cluster_driver" {
1214

1315
driver_inputs = {
1416
values_string = jsonencode({
15-
"name" = module.aws_eks.cluster_name
16-
"loadbalancer" = local.ingress_address
17-
"region" = var.region
17+
"name" = module.aws_eks.cluster_name
18+
"loadbalancer" = local.ingress_address
19+
"loadbalancer_hosted_zone" = data.aws_elb_hosted_zone_id.main.id
20+
"region" = var.region
1821
}),
1922
secrets_string = jsonencode({
2023
"credentials" = {

0 commit comments

Comments
 (0)