Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 16, 2024
1 parent 54ac72e commit 7b4c3db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
4 changes: 2 additions & 2 deletions deployment/live/example-gcp/ci/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
source = "${get_repo_root()}/deployment/modules/example-gcp"
source = "${get_repo_root()}/deployment/modules//example-gcp"
}

include "root" {
Expand All @@ -10,7 +10,7 @@ include "root" {
inputs = merge(
include.root.locals,
{
example_docker_image = "todo"
example_gcp_docker_image = "todo"
}
)

2 changes: 1 addition & 1 deletion deployment/live/example-gcp/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
source = "${get_repo_root()}/deployment/modules/example-gcp"
source = "${get_repo_root()}/deployment/modules//example-gcp"
}

locals {
Expand Down
23 changes: 10 additions & 13 deletions deployment/modules/example-gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ terraform {
}

module "gcp" {
source = "../"
source = "..//gcp"

base_name = var.base_name
env = var.env
location = var.location
project_id = var.project_id
}

###
Expand All @@ -24,21 +29,16 @@ resource "google_project_iam_member" "iam_metrics_writer" {
role = "roles/monitoring.metricWriter"
member = "serviceAccount:${google_service_account.cloudrun_service_account.email}"
}
resource "google_project_iam_member" "iam_sql_client" {
resource "google_project_iam_member" "iam_spanner_client" {
project = var.project_id
role = "roles/cloudsql.client"
role = "roles/spanner.client"
member = "serviceAccount:${google_service_account.cloudrun_service_account.email}"
}
resource "google_project_iam_member" "iam_service_agent" {
project = var.project_id
role = "roles/run.serviceAgent"
member = "serviceAccount:${google_service_account.cloudrun_service_account.email}"
}
resource "google_project_iam_member" "iam_secret_accessor" {
project = var.project_id
role = "roles/secretmanager.secretAccessor"
member = "serviceAccount:${google_service_account.cloudrun_service_account.email}"
}

resource "google_cloud_run_v2_service" "default" {
name = "example-service-${var.env}"
Expand All @@ -53,8 +53,8 @@ resource "google_cloud_run_v2_service" "default" {
args = [
"--logtostderr",
"--v=1",
"--bucket=${modules.infra.outputs.log_bucket}",
"--spanner=${modules.infra.outputs.log_spanner}",
"--bucket=${module.gcp.log_bucket.id}",
"--spanner=${module.gcp.log_spanner.id}",
"--project=${var.project_id}",
"--signer=./testgcp.sec",
]
Expand All @@ -80,13 +80,10 @@ resource "google_cloud_run_v2_service" "default" {
}
client = "terraform"
depends_on = [
google_project_service.secretmanager_api,
google_project_service.spanner_api,
google_project_iam_member.iam_act_as,
google_project_iam_member.iam_metrics_writer,
google_project_iam_member.iam_spanner_client,
google_project_iam_member.iam_service_agent,
google_project_iam_member.iam_secret_accessor,
]
}

Expand Down

0 comments on commit 7b4c3db

Please sign in to comment.