Remediation
From Google Cloud Consoleβ
- Go to the
VM instances
page by visiting: https://console.cloud.google.com/compute/instances. - Click on the impacted VM instance.
- If the instance is not stopped, click the
Stop
button. Wait for the instance to be stopped. - Next, click the
Edit
button. - Scroll down to the
Service Account
section. - Select a different service account or ensure that
Allow full access to all Cloud APIs
is not selected. - Click the
Save
button to save your changes and then clickSTART
.
From Google Cloud CLIβ
-
Stop the instance:
gcloud compute instances stop <INSTANCE_NAME>
-
Update the instance:
gcloud compute instances set-service-account <INSTANCE_NAME> --service-account=<SERVICE_ACCOUNT> --scopes [SCOPE1, SCOPE2...]
-
Restart the instance:
gcloud compute instances start <INSTANCE_NAME>