Add Google Cloud Platform (GCP) Credential
In order to allow Devopness to manage GCP resources on your behalf, Service Account key has to be provided.
If you don't have access to a GCP account, you can create an account for free following the cloud provider specific guide Google Cloud Free Tier
Select your GCP project
-
Access a GCP project or create a new one: https://console.cloud.google.com/project
If you created a new project, a notification modal will appear showing your new project creation status. Note: It might take a few seconds for the new project to be visible in the project list. If your new project is not listed a few seconds after its creation, reload the console page.
Enable GCP Compute Engine API
- Make sure
Compute Engine APIis enabled on the selected Project:- On GCP console, click on the dropdown menu and select APIs and Services
- Make sure the correct project is selected in GCP console's header left side
- Click on Enable APIs and Services on top of the page
- On the Search box, enter "Compute Engine API" and select it from search results
- If
Compute Engine APIis already activated, you will see theManagebutton at the screen - Otherwise, click
Enablebutton
Enable GCP IAM API
- Make sure
IAM APIis enabled on the selected Project:- On GCP console, click on the dropdown menu and select APIs and Services
- Make sure the correct project is selected in GCP console's header left side
- Click on Enable APIs and Services on top of the page
- On the Search box, enter "IAM API" and select it from search results
- If
IAM APIis already activated, you will see theManagebutton at the screen - Otherwise, click
Enablebutton
Enable GCP Cloud Resource Manager API
- Make sure
Cloud Resource Manager APIis enabled on the selected Project:- On GCP console, click on the dropdown menu and select APIs and Services
- Make sure the correct project is selected in GCP console's header left side
- Click on Enable APIs and Services on top of the page
- On the Search box, enter "Cloud Resource Manager API" and select it from search results
- If
Cloud Resource Manager APIis already activated, you will see theManagebutton at the screen - Otherwise, click
Enablebutton
Enable GCP Cloud Asset API
- Make sure
Cloud Asset APIis enabled on the selected Project:- On GCP console, click on the dropdown menu and select APIs and Services
- Make sure the correct project is selected in GCP console's header left side
- Click on Enable APIs and Services on top of the page
- On the Search box, enter "Cloud Asset API" and select it from search results
- If
Cloud Asset APIis already activated, you will see theManagebutton at the screen - Otherwise, click
Enablebutton
Set up a GCP service account
- Go back to projects console
- Having your project listed, click the three dot button on it and pick the
Settingsoption - On the left side menu under
IAM & Admin, select theService Accountsoption - Make sure a service account named as
<project-id>-compute@developer.gserviceaccount.comis listed - If you do not have a service account, create a new one:
- Click
+ CREATE SERVICE ACCOUNToption below the search bar - Name your new service account
- Click
DONE
- Click
- Having your service account listed, go to the
Actionscolumn, click the three dot menu on your service account and chooseManage detailsoption - Copy your service account email to your clipboard
Grant required IAM roles to the service account
:::info Why are these permissions required?
Devopness requires these roles to fully manage your infrastructure lifecycle on GCP.
In addition to reading resources, it must be able to create, start, stop, and delete Compute Engine instances when provisioning or updating environments.
The roles requested follow the principle of least privilege and avoid primitive roles like Owner or Editor.
:::
Grant the Compute Engine Service Broker role
- Below your service account name, go to the
PERMISSIONStab - In the permissions table, go to
VIEW BY ROLEStab - Make sure your service account has the
Compute Engine Service Brokerrole
You may need to check the box labeled "Include Google-provided role grants" to see the Compute Engine Service Broker role in the list.
- If the service account doesn't have the
Compute Engine Service Brokerrole, set it:- Click
GRANT ACCESSbutton - The
Grant access to "..."form will be displayed - Under
Add Principals, click theNew principalsfield and paste the service account email you copied earlier - Under
Assign roles, click theRolefield and select theCompute Engine Service Brokeroption - Click
SAVE
- Click
Grant the Compute Instance Administrator role
-
Below your service account name, go to the
PERMISSIONStab -
In the permissions table, go to
VIEW BY ROLEStab -
Make sure your service account has the
Compute Instance Administrator (v1)role -
If the service account doesn't have the
Compute Instance Administrator (v1)role, set it:- Click
GRANT ACCESSbutton - The
Grant access to "..."form will be displayed - Under
Add Principals, click theNew principalsfield and paste the service account email you copied earlier - Under
Assign roles, click theRolefield and select theCompute Instance Administrator (v1)option - Click
SAVE
- Click
Grant the Compute Security Administrator role
-
Below your service account name, go to the
PERMISSIONStab -
In the permissions table, go to
VIEW BY ROLEStab -
Make sure your service account has the
Compute Security Administratorrole -
If the service account doesn't have the
Compute Security Administratorrole, set it:- Click
GRANT ACCESSbutton - The
Grant access to "..."form will be displayed - Under
Add Principals, click theNew principalsfield and paste the service account email you copied earlier - Under
Assign roles, click theRolefield and select theCompute Security Administratoroption - Click
SAVE
- Click
Grant the Reader role
-
Below your service account name, go to the
PERMISSIONStab -
In the permissions table, go to
VIEW BY ROLEStab -
Make sure your service account has the
Readerrole -
If the service account doesn't have the
Readerrole, set it:- Click
GRANT ACCESSbutton - The
Grant access to "..."form will be displayed - Under
Add Principals, click theNew principalsfield and paste the service account email you copied earlier - Under
Assign roles, click theRolefield - In the role selector, search for
Readeror locate it underBasicroles - Click
SAVE
- Click
Grant the Service Account User role
-
Below your service account name, go to the
PERMISSIONStab -
In the permissions table, go to
VIEW BY ROLEStab -
Make sure your service account has the
Service Account Userrole -
If the service account doesn't have the
Service Account Userrole, set it:- Click
GRANT ACCESSbutton - The
Grant access to "..."form will be displayed - Under
Add Principals, click theNew principalsfield and paste the service account email you copied earlier - Under
Assign roles, click theRolefield and select theService Account Useroption - Click
SAVE
- Click
Generate a service account key
- On the left side menu under
IAM & Admin, select theService Accountsoption - Go to the
Actionscolumn on your service account, click the three dot menu and chooseManage keysoption - Add a new service account key:
- Click
ADD KEYbutton - Select
Create new keyoption - Pick
JSONkey type - Click
CREATE
- Click
- A JSON file containing your service account credentials will be downloaded, copy its content to your clipboard
Add credentials to Devopness
- To add the copied credentials to Devopness, follow the guide Add credential