diff --git a/terraform/cloud_storage/main.tf b/terraform/cloud_storage/main.tf index b3d122d..b59435a 100644 --- a/terraform/cloud_storage/main.tf +++ b/terraform/cloud_storage/main.tf @@ -13,3 +13,24 @@ resource "google_storage_bucket" "website_images" { enabled = var.bucket_versioning } } + +resource "google_storage_bucket" "website" { + name = var.bucket_name + location = var.bucket_location + storage_class = var.bucket_storage_class + force_destroy = var.bucket_force_destroy + uniform_bucket_level_access = var.bucket_uniform_bucket_level_access + + versioning { + enabled = var.bucket_versioning + } +} + +resource "google_storage_bucket_iam_binding" "all_users_read" { + bucket = google_storage_bucket.website.name + role = "roles/storage.objectViewer" + + members = [ + "allUsers", + ] +}