GCP Rapid Buckets (beta)
Tradeoffs and How We Mitigate Them
Configuration
locals {
# GCP Rapid Storage buckets are zonal, so create one bucket per zone that
# your WarpStream Agents run in.
#
# https://cloud.google.com/storage/docs/locations
region = "us-east1"
rapid_storage_zones = ["us-east1-b", "us-east1-c", "us-east1-d"]
}
resource "google_storage_bucket" "warpstream_rapid_storage_buckets" {
count = length(local.rapid_storage_zones)
name = "warpstream-rapid-${local.rapid_storage_zones[count.index]}"
location = local.region
soft_delete_policy {
# Disable soft deletion, otherwise deleted data is retained (and billed)
# for 7 days by default.
retention_duration_seconds = 0
}
versioning {
# Make sure versioning is disabled or it will massively inflate your
# storage costs.
enabled = false
}
lifecycle_rule {
condition {
age = 7
}
action {
type = "AbortIncompleteMultipartUpload"
}
}
# Everything below is required for Rapid Storage, do not remove.
storage_class = "RAPID"
uniform_bucket_level_access = true
hierarchical_namespace {
enabled = true
}
custom_placement_config {
# This is what pins the bucket to a single zone (the equivalent of
# gcloud's --placement flag).
data_locations = [local.rapid_storage_zones[count.index]]
}
}
# roles/storage.objectUser grants object read/write/delete/list, and is also
# required for the folder operations (create/delete) that hierarchical
# namespace buckets use.
resource "google_storage_bucket_iam_member" "warpstream_rapid_storage_object_user" {
count = length(local.rapid_storage_zones)
bucket = google_storage_bucket.warpstream_rapid_storage_buckets[count.index].name
role = "roles/storage.objectUser"
member = "serviceAccount:YOUR_SERVICE_ACCOUNT_EMAIL"
}
resource "google_storage_bucket_iam_member" "warpstream_rapid_storage_bucket_viewer" {
count = length(local.rapid_storage_zones)
bucket = google_storage_bucket.warpstream_rapid_storage_buckets[count.index].name
role = "roles/storage.bucketViewer"
member = "serviceAccount:YOUR_SERVICE_ACCOUNT_EMAIL"
}Last updated
Was this helpful?