Skip to content

Commit

Permalink
fixing error in concourse.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
afewell committed Jun 7, 2024
1 parent 399e3d8 commit d812959
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion terraform/paving-gcp-concourse-pat/concourse.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
locals {
concourse_name_initial = google_dns_record_set.concourse.name
concourse_name_no_trailing_dot = chomp(local.concourse_name_initial) # Removes trailing dot
concourse_name_final = regex_replace(local.concourse_name_no_trailing_dot, "^\\*\\.", "") # Removes leading *.
}

resource "google_dns_record_set" "concourse" {
name = "ci.${var.environment_name}.${data.google_dns_managed_zone.hosted-zone.dns_name}"
type = "A"
Expand Down Expand Up @@ -63,5 +69,5 @@ resource "google_compute_target_pool" "concourse_target_pool" {
}

output "concourse_url" {
value = replace(replace("${google_dns_record_set.concourse.name}", "/\.$/", ""), "*.", "")
value = local.concourse_name_final
}

0 comments on commit d812959

Please sign in to comment.