18 lines
532 B
HCL

resource "google_storage_bucket" "bucket" {
provider = google-beta
name = "${var.component_name}-gcf-source" # Every bucket name must be globally unique
location = var.region
uniform_bucket_level_access = true
}
data "archive_file" "default" {
type = "zip"
output_path = "/tmp/function-source.zip"
source_dir = "../src/"
}
resource "google_storage_bucket_object" "source" {
name = "function-source.zip"
bucket = google_storage_bucket.bucket.name
source = data.archive_file.default.output_path
}