Skip to content

Drop cname module and create resource directly #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ locals {
is_shared_vpc = data.aws_vpc.eks_vpc.owner_id != data.aws_caller_identity.current.account_id
region = var.region
vpc_domain_name = var.vpc_domain_name
record_type = "cname"
ttl = 900
}

#-------------------------------------------------
Expand Down Expand Up @@ -93,12 +95,20 @@ resource "aws_route53_zone_association" "self_zone_west" {
# Cluster DNS CNAME MAPPED TO INGRESS NLB
###################################################################

module "cname_cluster_domain" {
# tflint-ignore: terraform_module_pinned_source
source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname"

name = format("*.%v", local.cluster_domain_name)
values = [var.istio_ingress_lb]
zone = aws_route53_zone.cluster_domain.name
enable_heritage = false
}
# module "cname_cluster_domain" {
# # tflint-ignore: terraform_module_pinned_source
# source = "git@github.e.it.census.gov:terraform-modules/aws-dns//cname"

# name = format("*.%v", local.cluster_domain_name)
# values = [var.istio_ingress_lb]
# zone = aws_route53_zone.cluster_domain.name
# enable_heritage = false
# }

resource "aws_route53_record" "entry" {
zone_id = aws_route53_zone.cluster_domain.zone_id
name = "*.${local.cluster_domain_name}"
type = upper(local.record_type)
ttl = local.ttl
records = [var.istio_ingress_lb]
}
Comment on lines +108 to +114
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really prefer to use the upstream module.