Remediation
From Google Cloud Console
- Go to the
VM instancespage by visiting: https://console.cloud.google.com/compute/instances. - Click on the impacted VM instance.
- If the instance is not stopped, click the
Stopbutton. Wait for the instance to be stopped. - Next, click the
Editbutton. - Scroll down to the
Service Accountsection. - Select a different service account or ensure that
Allow full access to all Cloud APIsis not selected. - Click the
Savebutton 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>