https://pulumi.com logo
Title
q

quick-painter-61380

11/29/2021, 6:48 PM
I'm looking for some more detailed information about using pulumi import. I'm having trouble importing a GCS bucket. I think I have the ID wrong but I'm not sure what I should be using for it. I've tried the name, the URI (gs://<bucket name>), and a URI like https://www.googleapis.com/storage/v1/b/<bucket name>.
I keep getting that the resource doesn't exist
q

quick-painter-61380

11/29/2021, 6:55 PM
hum, ok, maybe it's just a bug in google-native then
r

red-match-15116

11/29/2021, 6:58 PM
oh you're using google native. The type token will be different... but could certainly be a bug too
q

quick-painter-61380

11/29/2021, 7:00 PM
in case anyone else is searching for the same thing, it seems it's not supported as of 0.9 of google-native. I used an ID like
<https://www.googleapis.com/storage/v1/b/><bucket name>
because that is what it showed for an ID when I created a new bucket but the google api shows
<https://storage.googleapis.com/storage/v1/b/><bucket name>
which changed my error from not found to not implemented.
f

fast-easter-23401

11/29/2021, 7:08 PM
Interesting, perhaps it's worth mentioning that
google-native
uses the selfLink attribute as the bucket ID according to this https://raw.githubusercontent.com/pulumi/pulumi-google-native/master/provider/cmd/pulumi-resource-google-native/metadata.json
"google-native:storage/v1:BucketObject": {
  "baseUrl": "<https://storage.googleapis.com/storage/v1/>",
            "createPath": "<https://storage.googleapis.com/upload/storage/v1/b/{bucket}/o>",
...,
  "assetUpload": true,
  "idProperty": "selfLink",
  "autoNamePattern": "{name}"
}, ...