For multi dev, you should use the
gcp-dev terraform directory to create your infrastructure.
Go to the IAM management dashboard, find the service account associated to the account you just logged into, and then add these roles to that service account (e.g. choose your account as the principal when adding new roles):
- Artifact Registry Read
- Artifact Registry Writer
- Cloud Run Developer
- Cloud SQL
- Service Account Token Creator
By default, Mage will use a SQLite database for each dev environment. SQLite does not perform well in the cloud, so we recommend using a Postgres database instead.
If you are using Google Cloud SQL, then the connection url will be in the following
gcp-dev terraform scripts will automatically create and connect to the PostgreSQL
database for you, but if you need the connection URL, it will look like this following:
You can refer to the GCP Terraform instructions
for how to deploy your infrastructure using Terraform. Make sure to set the variables in the
Once the Terraform scripts are run, you can create your development instances. There should be
a Cloud Run service created, and you can access it through the external IP address that is printed
at the end of
terraform apply. From there, you should be able to create your dev instances.