Skip to content

Commit

Permalink
adding concourse.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
afewell committed Jun 7, 2024
1 parent 93f7096 commit 399e3d8
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 373 deletions.
File renamed without changes.
67 changes: 67 additions & 0 deletions terraform/paving-gcp-concourse-pat/concourse.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
resource "google_dns_record_set" "concourse" {
name = "ci.${var.environment_name}.${data.google_dns_managed_zone.hosted-zone.dns_name}"
type = "A"
ttl = 60

managed_zone = var.hosted_zone

rrdatas = [google_compute_address.concourse.address]
}

//create a load balancer for concourse
resource "google_compute_address" "concourse" {
name = "${var.environment_name}-concourse"
}

resource "google_compute_firewall" "concourse" {
allow {
ports = ["443", "2222", "8000", "8443"]
protocol = "tcp"
}

direction = "INGRESS"
name = "${var.environment_name}-concourse-open"
network = google_compute_network.network.self_link
source_ranges = ["0.0.0.0/0"]
target_tags = ["concourse"]
}

resource "google_compute_forwarding_rule" "concourse_credhub" {
ip_address = google_compute_address.concourse.address
ip_protocol = "TCP"
name = "${var.environment_name}-concourse-credhub"
port_range = "8000-8000"
target = google_compute_target_pool.concourse_target_pool.self_link
}

resource "google_compute_forwarding_rule" "concourse_ssh" {
ip_address = google_compute_address.concourse.address
ip_protocol = "TCP"
name = "${var.environment_name}-concourse-ssh"
port_range = "2222-2222"
target = google_compute_target_pool.concourse_target_pool.self_link
}

resource "google_compute_forwarding_rule" "concourse_tcp" {
ip_address = google_compute_address.concourse.address
ip_protocol = "TCP"
name = "${var.environment_name}-concourse-tcp"
port_range = "443-443"
target = google_compute_target_pool.concourse_target_pool.self_link
}

resource "google_compute_forwarding_rule" "concourse_uaa" {
ip_address = google_compute_address.concourse.address
ip_protocol = "TCP"
name = "${var.environment_name}-concourse-uaa"
port_range = "8443-8443"
target = google_compute_target_pool.concourse_target_pool.self_link
}

resource "google_compute_target_pool" "concourse_target_pool" {
name = "${var.environment_name}-concourse"
}

output "concourse_url" {
value = replace(replace("${google_dns_record_set.concourse.name}", "/\.$/", ""), "*.", "")
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 0 additions & 29 deletions terraform/paving-gcp/pas-buckets.tf

This file was deleted.

69 changes: 0 additions & 69 deletions terraform/paving-gcp/pas-dns.tf

This file was deleted.

79 changes: 0 additions & 79 deletions terraform/paving-gcp/pas-firewalls.tf

This file was deleted.

Loading

0 comments on commit 399e3d8

Please sign in to comment.