We'll first create a service account with default access rights. Next, we'll launch a VM with the newly created service account. Ideally, the VM would not have direct access to Cloud SQL. Then, in IAM we'll assign the Cloud SQL admin rights to our service account and redo our verification:
- Launch the Google Cloud Shell from the Console:
- We'll create a service account using the following command:
$ gcloud iam service-accounts create my-sa-with-sql --display-name "Service a/c with sql access"
- To view all the service accounts, we can use the following command:
$ gcloud iam service-accounts listNAME EMAILService a/c with sql access my-sa-with-sql@upbeat-aura-163616.iam.gserviceaccount.com
The following screenshot shows the ...