Skip to content

Instantly share code, notes, and snippets.

@richardevcom
Last active July 17, 2024 23:13
Show Gist options
  • Save richardevcom/8aef3539314e8f6afe39cd538f5e2d32 to your computer and use it in GitHub Desktop.
Save richardevcom/8aef3539314e8f6afe39cd538f5e2d32 to your computer and use it in GitHub Desktop.
Google Cloud CLI command to disable all enabled services.
# Use --force to skip "usage" errors
gcloud services disable --project <project_id> $(gcloud services list --enabled --project <project_id> --format="value(NAME)")
@richardevcom
Copy link
Author

If you're getting this error:

ERROR: (gcloud.services.disable) FAILED_PRECONDITION: The service artifactregistry.googleapis.com has usage in the last 30 days. Please specify check_if_service_has_usage=SKIP if you want to proceed with disabling the service.

then use --force argument after gcloud services disable to skip this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment