Skip to content

update ingress example to remove cert-manager #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
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
32 changes: 16 additions & 16 deletions argocd/iac/terraform/examples/eks/argocd-ingress/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ locals {
gitops_addons_path = var.gitops_addons_path
gitops_addons_revision = var.gitops_addons_revision

enable_ingress = true
domain_private_zone = false
enable_ingress = true
is_route53_private_zone = false
# change to a valid domain name you created a route53 zone
# aws route53 create-hosted-zone --name example.com --caller-reference "$(date)"
domain_name = var.domain_name
argocd_subdomain = "argocd"
argocd_host = "${local.argocd_subdomain}.${local.domain_name}"
argocd_domain_arn = try(data.aws_route53_zone.domain_name[0].arn, "")
domain_name = var.domain_name
argocd_subdomain = "argocd"
argocd_host = "${local.argocd_subdomain}.${local.domain_name}"
route53_zone_arn = try(data.aws_route53_zone.this[0].arn, "")


aws_addons = {
enable_cert_manager = true
#enable_cert_manager = true
#enable_aws_efs_csi_driver = true
#enable_aws_fsx_csi_driver = true
#enable_aws_cloudwatch_metrics = true
Expand All @@ -68,10 +68,10 @@ locals {
#enable_aws_gateway_api_controller = true
#enable_aws_ebs_csi_resources = true # generate gp2 and gp3 storage classes for ebs-csi
#enable_aws_secrets_store_csi_driver_provider = true
enable_aws_argocd_ingress = true
enable_aws_argocd_ingress = true
}
oss_addons = {
enable_argocd = false
enable_argocd = false
#enable_argo_rollouts = true
#enable_argo_events = true
#enable_argo_workflows = true
Expand Down Expand Up @@ -170,7 +170,7 @@ module "eks_blueprints_addons" {
enable_velero = try(local.aws_addons.enable_velero, false)
enable_aws_gateway_api_controller = try(local.aws_addons.enable_aws_gateway_api_controller, false)

external_dns_route53_zone_arns = [local.argocd_domain_arn] # ArgoCD Server and UI domain name is registered in Route 53
external_dns_route53_zone_arns = [local.route53_zone_arn] # ArgoCD Server and UI domain name is registered in Route 53

tags = local.tags
}
Expand Down Expand Up @@ -252,10 +252,10 @@ module "vpc" {
# Route 53
################################################################################
# To get the hosted zone to be use in argocd domain
data "aws_route53_zone" "domain_name" {
data "aws_route53_zone" "this" {
count = local.enable_ingress ? 1 : 0
name = local.domain_name
private_zone = local.domain_private_zone
private_zone = local.is_route53_private_zone
}


Expand All @@ -269,18 +269,18 @@ resource "aws_acm_certificate" "cert" {
validation_method = "DNS"
}

resource "aws_route53_record" "cert" {
resource "aws_route53_record" "validation" {
count = local.enable_ingress ? 1 : 0
zone_id = data.aws_route53_zone.domain_name[0].zone_id
zone_id = data.aws_route53_zone.this[0].zone_id
name = tolist(aws_acm_certificate.cert[0].domain_validation_options)[0].resource_record_name
type = tolist(aws_acm_certificate.cert[0].domain_validation_options)[0].resource_record_type
records = [tolist(aws_acm_certificate.cert[0].domain_validation_options)[0].resource_record_value]
ttl = 60
allow_overwrite = true
}

resource "aws_acm_certificate_validation" "cert" {
resource "aws_acm_certificate_validation" "this" {
count = local.enable_ingress ? 1 : 0
certificate_arn = aws_acm_certificate.cert[0].arn
validation_record_fqdns = [for record in aws_route53_record.cert : record.fqdn]
validation_record_fqdns = [for record in aws_route53_record.validation : record.fqdn]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variable "domain_name" {
description = "Route 53 domain name"
type = string
type = string
}
variable "gitops_addons_org" {
description = "Git repository org/user contains for addons"
Expand Down