Google Cloud Platform (GCP)
Last updated
Was this helpful?
Last updated
Was this helpful?
Spacelift GCP integration allows Spacelift to manage your Google Cloud resources without the need for long-lived static credentials. In order to achieve that Spacelift create a inside our project dedicated for your Stack. We show you the globally unique email of this service account, which you can add to your GCP organizations and/or projects with the right level of access.
With the service account already created, we generate temporary OAuth token for this service account and put it as a GOOGLE_OAUTH_ACCESS_TOKEN
variable in the environment of your and . This is for the Google Terraform provider, so you can define it like this:
You can customize the list of that the token is granted when it's generated. When you're setting up your GCP integration through the web UI, we suggest the following list of scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/ndev.clouddns.readwrite
https://www.googleapis.com/auth/devstorage.full_control
https://www.googleapis.com/auth/userinfo.email
This list is consistent with the .
If you're setting up the integration through the web UI, please go to the Integrations tab in the stack management view and choose Google Cloud Platform from the list of available integrations:
If you're using Spacelift Terraform provider to create the integration programmatically, you can do the following:
If the service account linked to your administrative stack has sufficient privileges on the GCP organization, you can even programmatically create a dedicated GCP project and set up the integration from the Google side of things:
We can do the same on the project level, too. In fact, the process looks absolutely identical except that projects are represented by a different icon in the dropdown. Go figure:
It can take up to a minute for the membership data to propagate but once it does, your Spacelift-GCP integration should Just Work™.
Once there, you'll be presented with a form allowing you to customize the list of OAuth scopes for the temporary token we'll generate for each and :
Once you click Save, the account is generated for you and we display its globally unique email. You'll need this email when .
In order to make the integration work, you'll have to make the dedicated service account a member of your organization and/or project, with an appropriate level of access. This is done in the view of GCP's web UI. First, let's show an example of adding a service account as a member on the organization level: