Skip to content

Commit

Permalink
Pull the GCLB and DNS out of the app module (#284)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Moore <mattmoor@chainguard.dev>
  • Loading branch information
mattmoor authored May 18, 2024
1 parent ad1900d commit 91be077
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 59 deletions.
41 changes: 37 additions & 4 deletions iac/gclb.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
moved {
from = google_dns_managed_zone.top-level-zone
to = module.this.google_dns_managed_zone.top-level-zone
from = module.app.google_dns_managed_zone.top-level-zone
to = google_dns_managed_zone.top-level-zone
}

moved {
from = module.serverless-gclb
to = module.this.module.serverless-gclb
from = module.app.module.serverless-gclb
to = module.serverless-gclb
}

// This is imported from Cloud Domains
resource "google_dns_managed_zone" "top-level-zone" {
project = var.project_id
name = "octo-sts-dev"
dns_name = "octo-sts.dev."
description = "DNS zone for domain: octo-sts.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.6.18"

name = var.name
project_id = var.project_id
dns_zone = google_dns_managed_zone.top-level-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 = {
"octo-sts.dev" = {
name = var.name
}
}
}
20 changes: 0 additions & 20 deletions iac/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ data "google_monitoring_notification_channel" "octo-sts-slack" {
display_name = "Slack Octo STS Notification"
}

moved {
from = google_kms_key_ring.app-keyring
to = module.this.google_kms_key_ring.app-keyapp-keyring
}

moved {
from = google_kms_crypto_key.app-key
to = module.this.google_kms_crypto_key.app-key
}

moved {
from = google_service_account.octo-sts
to = module.this.google_service_account.octo-sts
}

// Build each of the application images from source.
resource "ko_build" "this" {
working_dir = "${path.module}/.."
Expand Down Expand Up @@ -70,8 +55,3 @@ module "app" {
github_app_key_version = 1
notification_channels = local.notification_channels
}

moved {
from = module.this
to = module.app.module.this
}
32 changes: 0 additions & 32 deletions modules/app/gclb.tf

This file was deleted.

3 changes: 0 additions & 3 deletions modules/app/outputs.tf

This file was deleted.

0 comments on commit 91be077

Please sign in to comment.