Skip to content

Commit

Permalink
Revert #1358 (#1389)
Browse files Browse the repository at this point in the history
* Revert "Revert "Set up a DNS zone and GCLB for edu. (#1342)" (#1358)"
Signed-off-by: Matt Moore <[email protected]>
  • Loading branch information
mattmoor authored Feb 23, 2024
1 parent ccdb04a commit 0ffaee0
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions iac/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ provider "google-beta" { project = var.project_id }

module "networking" {
source = "chainguard-dev/common/infra//modules/networking"
version = "0.2.0"
version = "0.5.3"

name = var.name
project_id = var.project_id
regions = [var.primary-region]
name = var.name
project_id = var.project_id
netnum_offset = 1 # Avoids replacement
regions = [var.primary-region]
}

resource "google_service_account" "chainguard-academy" {
Expand Down Expand Up @@ -66,6 +67,33 @@ resource "google_cloud_run_v2_service_iam_member" "public-services-are-unauthent
member = "allUsers"
}

output "urls" {
value = { for k, v in google_cloud_run_v2_service.chainguard-academy : k => v.uri }
resource "google_dns_managed_zone" "edu-zone" {
project = var.project_id
name = "edu-chainguard-dev"
dns_name = "edu.chainguard.dev."

dnssec_config {
state = "on"
}
}

// Put the above domain in front of our regional services.
module "serverless-gclb" {
source = "chainguard-dev/common/infra//modules/serverless-gclb"
version = "0.5.3"

name = var.name
project_id = var.project_id
dns_zone = google_dns_managed_zone.edu-zone.name

// Regions are all of the places that we have backends deployed.
// Regions must be removed from serving before they are torn down.
regions = keys(module.networking.regional-networks)
serving_regions = keys(module.networking.regional-networks)

public-services = {
"edu.chainguard.dev" = {
name = var.name
}
}
}

0 comments on commit 0ffaee0

Please sign in to comment.