API: Implement GraphQL and REST endpoints to return Google Cloud project setup script
Expose a GraphQL field and a REST endpoint that provide the frontend with the required script for setting up a Google Cloud project to use for runner creation:
From @pedroms
in Slack (internal-only):
In this step of the runner creation flow:
- The user provides the Google Cloud project ID where they would like to provision the runner in. This field is empty by default, user must indicate the project every time.
- That Google Cloud project must be configured to connect to GitLab and use the runner. This configuration is specific to the runner creation use case. When that project is properly configured:
- It enables GitLab to fetch the allowed regions/zones/machine types for the next step/screen in this runner creation flow.
- It enables GRIT/Terraform to do its magic on that Google Cloud project.
- The configuration would involve 1+ manual scripts (using glab or gcloud, not sure). I imagined it would (at least) include:
- Enable the required APIs in Google Cloud (e.g. Compute Engine API). This ensures that the needed products/services are available.
- Grant the necessary IAM roles or permissions to the WLIF principalSet (e.g. roles/compute.instanceAdmin). The ensures that GitLab can connect to the runners in Google Cloud and read/write whatever is needed for this integration (e.g. read allowed machine types for that Google Cloud project).
- Maybe create a service account or grant IAM policies to an existing service account (I remember Jason from Google mentioning we needed a service account for something in runners in Google Cloud)
- <more?>