Giter Club home page Giter Club logo

Comments (10)

lukehoban avatar lukehoban commented on July 22, 2024 4

You can set this via config with pulumi config set gcp:project. I’ll leave this issue open to track how we can make sure the error messages and/or documentation are clearer as this has been a common tripping point.

from pulumi-gcp.

joeduffy avatar joeduffy commented on July 22, 2024

Hmm, the error message makes it look like a property of the bucket object? Does it default to the provider config or something like that?

from pulumi-gcp.

joeduffy avatar joeduffy commented on July 22, 2024

P.s. if this config really is required -- or even just recommended -- let's make sure this page covers it, as Luke suggested: https://pulumi.io/reference/gcp.html

from pulumi-gcp.

sohailalam2 avatar sohailalam2 commented on July 22, 2024

@lukehoban @joeduffy thanks for the quick reply. I am already setting the google credentials like so export GOOGLE_CREDENTIALS=$(cat credentials.json) and this json does contain the project id. So I dont completly understand what exactly to set here pulumi config set gcp:project?... is it project name or project id?

UPDATE:

OK, so its not the project name. Its the project id.. and this seems kind of redundant because the credentials.json already contains the required fields.

from pulumi-gcp.

sohailalam2 avatar sohailalam2 commented on July 22, 2024

Also, how can I set these config programmatically?

from pulumi-gcp.

swgillespie avatar swgillespie commented on July 22, 2024

I wrote some of this down in the installation section, but I'll add it to the reference page too - it's not very clear.

Any resource that requires a project, region, or zone accepts an optional project, region, or zone property. These fields are marked as optional because, if they are not set, we pull default values for them from the GOOGLE_PROJECT, GOOGLE_REGION, and GOOGLE_ZONE environment variables. You can also use gcp:project, gcp:region, and gcp:zone config keys if you don't want to use environment variables. I'll document this better on the website since it's not obvious.

from pulumi-gcp.

sohailalam2 avatar sohailalam2 commented on July 22, 2024

Thanks, @swgillespie for the update.

However, I still think its good to pull in the values from the credentials.json if it already exists. One has an option to override it for whatsoever reason, however, using the default values (from the gcp generated credential file) is more meaningful.

from pulumi-gcp.

swgillespie avatar swgillespie commented on July 22, 2024

Thank you for trying this out! 😄

However, I still think its good to pull in the values from the credentials.json if it already exists.

It's true that there's a project ID in the credentials file, but the project in there is the project to which the service account belongs, which is not necessarily the one into which you want to deploy resources.

Honestly, I'm not familiar enough with GCP to know if that's a reasonable default. Do you think that people will be (in general) expecting to deploy resources into the same project that their service account belongs to?

from pulumi-gcp.

sohailalam2 avatar sohailalam2 commented on July 22, 2024

@swgillespie... the service account credentials most likely wont even have access to other projects, so I think that it is a reasonable default.

Apart from this, if anyone wants to change it, they do have this option using the environment variables, but for people like me (I am so lazy LOL) it would be nice to use this as a default value.

You may close the issue if you think otherwise and/or implement this as a default :)
Thanks.

from pulumi-gcp.

pgavlin avatar pgavlin commented on July 22, 2024

This is now fixed.

from pulumi-gcp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.