I am trying to import a bucket that is sitting in ...
# google-cloud
e
I am trying to import a bucket that is sitting in another gcp project. My service account has the correct permissions, because I have been using this bucket to manage the stacks fine. but when I try to import I get a difference in project. Can I have in my stack a resource sitting in a gcp project different from the stack it self?
Copy code
export const Bucket = new Bucket(config.pulumiBucket, {
    name: "my-bucket",
    project: "project-b",
    location: 'US',
    versioning: {
        enabled: true
    },
    labels: {
        owner: "ops",
        environment: "staging",
        description: "some-description"
    }
}, {
    import: "my-bucket",
});
my stack is configured to be in another project:
Copy code
config:
  gcp:project: project-a
the service account has access to the bucket.
f
You can construct a separate provider for that project, e.g.
const projectBProvider = new gcp.Provider("proj-b-provider", { project: "project-b" … })
and then pass that provider to the constructor as an option, e.g.
new Bucket(config.pulumiBucket, { … }, { import: "my-bucket", provider: projectBProvider })
e
ahhh nice
going to try that
that worked man! Thanks!
👍 1