Skip to content

Commit

Permalink
tf fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Jul 4, 2024
1 parent 1a3818e commit e34a1a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions deployment/modules/gcs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@ resource "google_service_account" "log_writer" {

# Buckets

resource "google_storage_bucket" "log" {
resource "google_storage_bucket" "log_bucket" {
name = "${var.project_id}-${var.base_name}-bucket"
location = var.location
name = var.base_name
storage_class = "STANDARD"
uniform_bucket_level_access = true
}

resource "google_storage_bucket_iam_binding" "log_bucket_writer" {
bucket = google_storage_bucket.log.name
bucket = google_storage_bucket.log_bucket.name
role = "roles/storage.legacyBucketWriter"
members = [
google_service_account.log_writer.member
]
}
resource "google_storage_bucket_iam_member" "log_bucket_reader" {
bucket = google_storage_bucket.log.name
bucket = google_storage_bucket.log_bucket.name
role = "roles/storage.legacyObjectReader"
member = "allUsers"
}

# Spanner

resource "google_spanner_instance" "log" {
resource "google_spanner_instance" "log_spanner" {
name = var.base_name
config = "regional-${var.location}"
display_name = "${var.base_name} Spanner Instance"
processing_units = 100
}

resource "google_spanner_database" "log" {
instance = google_spanner_instance.log.name
resource "google_spanner_database" "log_db" {
instance = google_spanner_instance.log_spanner.name
name = "${var.base_name}-db"
ddl = [
"CREATE TABLE SeqCoord (id INT64 NOT NULL, next INT64 NOT NULL,) PRIMARY KEY (id)",
Expand All @@ -68,8 +68,8 @@ resource "google_spanner_database" "log" {
}

resource "google_spanner_database_iam_binding" "database" {
instance = google_spanner_instance.log
database = google_spanner_database.log
instance = google_spanner_instance.log_spanner.name
database = google_spanner_database.log_db.name
role = "roles/compute.networkUser"

members = [
Expand Down
2 changes: 1 addition & 1 deletion deployment/modules/gcs/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "log_bucket" {
description = "Log GCS bucket"
value = google_storage_bucket.log
value = google_storage_bucket.log_bucket
}

0 comments on commit e34a1a8

Please sign in to comment.