Skip to content

Instantly share code, notes, and snippets.

@tatsuyasusukida
Created September 21, 2022 01:49
Show Gist options
  • Save tatsuyasusukida/e27977c892fed4f55d6f30c3c0570eca to your computer and use it in GitHub Desktop.
Save tatsuyasusukida/e27977c892fed4f55d6f30c3c0570eca to your computer and use it in GitHub Desktop.
Terraform GCP Cloud Storage Bucket example
variable "project" {}
variable "bucket_name" {}
variable "bucket_location" {}
provider "google" {
project = var.project
}
resource "google_storage_bucket" "my_bucket" {
name = var.bucket_name
location = var.bucket_location
force_destroy = true
}
output "bucket_name" {
value = google_storage_bucket.my_bucket.name
}
project = "<PROJECT_ID>"
bucket_name = "my-bucket-00000000"
bucket_location = "ASIA-NORTHEAST1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment