Skip to content

Commit

Permalink
feat: add data sources for Google Storage buckets and update IAM bind…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
Gezi-lzq committed Nov 14, 2024
1 parent 569805c commit abfe6c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions google.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,23 @@ resource "google_storage_bucket" "automq_byoc_ops_bucket" {
}
}

data "google_storage_bucket" "ops_bucket" {
name = local.automq_ops_bucket
}
data "google_storage_bucket" "data_bucket" {
name = local.automq_data_bucket
}

resource "google_storage_bucket_iam_binding" "automq_data_storage_permission_binding" {
bucket = local.automq_data_bucket
bucket = data.google_storage_bucket.data_bucket.name
role = google_project_iam_custom_role.automq_byoc_storage_role.name
members = [
"serviceAccount:${google_service_account.automq_byoc_sa.email}"
]
}

resource "google_storage_bucket_iam_binding" "automq_ops_storage_permission_binding" {
bucket = local.automq_ops_bucket
bucket = data.google_storage_bucket.ops_bucket.name
role = google_project_iam_custom_role.automq_byoc_storage_role.name
members = [
"serviceAccount:${google_service_account.automq_byoc_sa.email}"
Expand Down

0 comments on commit abfe6c8

Please sign in to comment.