https://pulumi.com logo
#google-cloud
Title
# google-cloud
l

lemon-wire-69305

08/10/2021, 3:46 AM
Hi everyone, I'm having trouble getting an object from GCS. My code looks like:
Copy code
const bucketId = "<gs://my-bucket/my-file.json>";
const testData = gcp.storage.BucketObject.get("object-test", bucketId);
console.log(testData);
Running
pulumi up
gives me
Preview failed: resource '<gs://my-bucket/my-file.json>' does not exist
SO it seems that Pulumi does not like the value I'm giving it as the Id. Using
gsutil
I can however do:
Copy code
gsutil cat <gs://my-bucket/my-file.json>
Which works fine. The bucket object was created outside of Pulumi and is private. Any ideas what value I should be using as the ID?
m

modern-napkin-96707

08/31/2021, 12:44 PM
You probably figured this out already, but my guess is the bucketId should be just the name of the bucket.