- Note Project id : First note down the project-id of the project where you are deploying our solution . Project id can be found by clicking on the project dropdown and copying id from the poped up window.
- Activate cloud shell by clicking the shell icon at the top right corner.
- In the cloud shell, run below command to switch to the project where you are deploying this solution , replace PROJECT_ID with the actual project id copied in step a.
gcloud config set project "PROJECT_ID"
- Then run below command to create new service account, replace highlighted bold text with suitable values.
gcloud iam service-accounts create "your-service-account-name" --description="service account for your-google-cloud-login-emailid " --display-name="your-service-account-name"
- Then run below command to associate the newly created service account with your google cloud login id, replace highlighted bold text with values provided in above steps
gcloud iam service-accounts add-iam-policy-binding your-service-account-name@projectid-copied-in-step-a.iam.gserviceaccount.com --member="user:your-google-cloud-login-emailid" --role="roles/iam.serviceAccountUser"
- Then run below 3 commands one after the other , replace highlighted bold text with your service account name provided in previous steps.
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:your-service-account-name@projectid-copied-in-step-a.iam.gserviceaccount.com --role=roles/config.agent
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:your-service-account-name@projectid-copied-in-step-a.am.gserviceaccount.com --role=roles/compute.admin
gcloud projects add-iam-policy-binding PROJECT_ID --member=serviceAccount:your-service-account-name@projectid-copied-in-step-a.iam.gserviceaccount.com --role=roles/iam.serviceAccountUser
- Once the above steps are done, wait for 60 seconds then refresh the deployment page and you should see the newly created service account in "Select a service account". Continue with the next steps below.