Hi all! I'm struggling to figure out how nested b...
# google-cloud
l
Hi all! I'm struggling to figure out how nested buckets are created with GCS. My code looks like:
Copy code
const bucketHome = new gcp.storage.Bucket("bucket-web", {
  name: bucketHomeName,
  location: hostArea,
});

const bucketFrontendDeploys = new gcp.storage.Bucket("bucket-frontend-deploys", {
  name: pulumi.interpolate`${bucketHome.name}/deploy/frontend`,
  location: hostArea,
});
But Google doesn't allow slashes in a bucket name, so although
bucket-web
will be created fine, the second
bucket-frontend-deploys
will give back an error
googleapi: Error 400: Invalid bucket name
when I run
pulumi up
. That leaves me with the question: How exactly do you created nested buckets?! It feels like there's something simple that I'm missing. Any pointers would be much appreciated.
hmmm.. I've been reading through the docs and it seems that it's not possible to create subdirectories - only files that "appear" to be in subdirectories. https://cloud.google.com/storage/docs/naming-objects
a
Hi Louis, this issue is not related to Pulumi. If you are looking for an analogy: the bucket is the storage (ie, the disk), and what you put inside, objects, are like files. GCP has retriction on bucket name, so you cannot use slash in bucket name. The general principle is explained hereĀ : https://en.wikipedia.org/wiki/Object_storage
šŸ‘ 1