Skip to content

Commit

Permalink
fix: always specify project
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlo03 committed Sep 19, 2024
1 parent 0e16881 commit 0f15f1e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
12 changes: 7 additions & 5 deletions terraform/modules/autoscaler-base/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ resource "google_project_iam_member" "poller_sa_spanner" {
// Downstream topic

resource "google_pubsub_topic" "downstream_topic" {
name = "downstream-topic"
project = var.project_id
name = "downstream-topic"

depends_on = [google_pubsub_schema.scaler_downstream_pubsub_schema]

schema_settings {
schema = google_pubsub_schema.scaler_downstream_pubsub_schema.id
schema = google_pubsub_schema.scaler_downstream_pubsub_schema.id
encoding = "JSON"
}

Expand All @@ -46,9 +47,10 @@ resource "google_pubsub_topic_iam_member" "scaler_downstream_pub_iam" {
}

resource "google_pubsub_schema" "scaler_downstream_pubsub_schema" {
name = "downstream-schema"
type = "PROTOCOL_BUFFER"
definition = "${file("${path.module}/../../../src/scaler/scaler-core/downstream.schema.proto")}"
project = var.project_id
name = "downstream-schema"
type = "PROTOCOL_BUFFER"
definition = file("${path.module}/../../../src/scaler/scaler-core/downstream.schema.proto")
}

resource "google_project_iam_member" "metrics_publisher_iam_poller" {
Expand Down
9 changes: 6 additions & 3 deletions terraform/modules/autoscaler-functions/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ terraform {
// PubSub

resource "google_pubsub_topic" "poller_topic" {
name = "poller-topic"
project = var.project_id
name = "poller-topic"
}

resource "google_pubsub_topic_iam_member" "poller_pubsub_sub_iam" {
Expand All @@ -43,7 +44,8 @@ resource "google_pubsub_topic_iam_member" "forwarder_pubsub_pub_iam" {
}

resource "google_pubsub_topic" "scaler_topic" {
name = "scaler-topic"
project = var.project_id
name = "scaler-topic"
}

resource "google_pubsub_topic_iam_member" "poller_pubsub_pub_iam" {
Expand All @@ -63,6 +65,7 @@ resource "google_pubsub_topic_iam_member" "scaler_pubsub_sub_iam" {
// Cloud Functions

resource "google_storage_bucket" "bucket_gcf_source" {
project = var.project_id
name = "${var.project_id}-gcf-source"
storage_class = "REGIONAL"
location = var.region
Expand All @@ -74,7 +77,7 @@ data "archive_file" "local_source" {
type = "zip"
source_dir = abspath("${path.module}/../../..")
output_path = "${var.local_output_path}/src.zip"
excludes = [ ".git", ".github", ".nyc_output", ".vscode", "kubernetes", "node_modules", "resources", "scaler", "terraform" ]
excludes = [".git", ".github", ".nyc_output", ".vscode", "kubernetes", "node_modules", "resources", "scaler", "terraform"]
}

resource "google_storage_bucket_object" "gcs_functions_source" {
Expand Down

0 comments on commit 0f15f1e

Please sign in to comment.