Skip to content

Commit

Permalink
Spanner IAM
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 16, 2024
1 parent 93c0815 commit e249c37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions deployment/modules/example-gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ 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_spanner_database_user" {
project = var.project_id
role = "roles/spanner.databaseUser"
member = "serviceAccount:${google_service_account.cloudrun_service_account.email}"
resource "google_spanner_database_iam_binding" "iam_spanner_database_user" {
project = var.project_id
instance = module.gcp.log_spanner.name
database = module.gcp.log_db.name
role = "roles/spanner.databaseUser"

members = [
"serviceAccount:${google_service_account.cloudrun_service_account.email}"
]
}
resource "google_project_iam_member" "iam_service_agent" {
project = var.project_id
Expand Down
2 changes: 1 addition & 1 deletion deployment/modules/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resource "google_storage_bucket_iam_binding" "log_bucket_writer" {
resource "google_spanner_instance" "log_spanner" {
name = var.base_name
config = "regional-${var.location}"
display_name = "${var.base_name} Spanner Instance"
display_name = var.base_name
processing_units = 100
}

Expand Down

0 comments on commit e249c37

Please sign in to comment.