{"id":20832956,"url":"https://github.com/udhos/gcpkillbilling","last_synced_at":"2026-05-15T16:35:06.527Z","repository":{"id":75074222,"uuid":"136942251","full_name":"udhos/gcpkillbilling","owner":"udhos","description":"gcpkillbilling removes all projects from a GCP billing account. CAUTION DANGEROUS.","archived":false,"fork":false,"pushed_at":"2018-06-26T14:54:26.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T11:50:48.559Z","etag":null,"topics":["billing","cloud","gcp","go","golang","google-cloud"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/udhos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-11T15:02:23.000Z","updated_at":"2018-06-26T14:54:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"a71bc52c-21b6-49de-ac21-3af332ad7b27","html_url":"https://github.com/udhos/gcpkillbilling","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/udhos/gcpkillbilling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fgcpkillbilling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fgcpkillbilling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fgcpkillbilling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fgcpkillbilling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udhos","download_url":"https://codeload.github.com/udhos/gcpkillbilling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udhos%2Fgcpkillbilling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33072601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["billing","cloud","gcp","go","golang","google-cloud"],"created_at":"2024-11-18T00:13:49.183Z","updated_at":"2026-05-15T16:35:06.501Z","avatar_url":"https://github.com/udhos.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gcpkillbilling\n\ngcpkillbilling removes all projects from a GCP billing account.\nCAUTION DANGEROUS.\n\nInstall GCP SDK\n===============\n\nMore information here: https://cloud.google.com/sdk/docs/#linux\n\n    wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-192.0.0-linux-x86_64.tar.gz\n    tar xf google-cloud-sdk-192.0.0-linux-x86_64.tar.gz\n    ./google-cloud-sdk/install.sh\n    gcloud init\n\nBuild\n=====\n\n    go get github.com/udhos/gcpkillbilling\n    cd ~/go/src/github.com/udhos/gcpkillbilling\n    ./build.sh\n\nCreate GCP pubsub topic and subscription\n========================================\n\nExample:\n\n    GCP Main Billing Account:    main-account\n    GCP Project:                   main-project\n    GCP IAM Service Account:         main-killbill (main-killbill@main-project.iam.gserviceaccount.com)\n    GCP Pubsub Topic:                budget-alerts\n    GCP Pubsub Subscription:           killbill-queue (subscription type must be 'pull')\n    GCP Limited Billing Account: capped-account\n    GCP Budget:                    capped-budget\n    GCP Limited Project:           capped-project\n\nCreate pubsub topic 'budget-alerts' under project 'main-project'.\n\nCreate pull-type subscription 'killbill-queue' under topic 'budget-alerts'.\n\nCreate a budget 'capped-budget' under account 'capped-account' with notification set to topic 'budget-alerts'.\n\nCreate a project 'capped-project' linked to account 'capped-account'.\n\nCreate an IAM service account 'main-killbill' to authorize the killbill application. Grant the service account these privileges:\n- Project OWNER in the capped-project. The killbill application needs this permission in order to change the billing info for the project.\n- Pubsub EDITOR (publish/consume messages). The killbill application needs this permission to publish and consume pubsub messages.\n- Billing ADMIN the capped-account. Killbill application needs this permission to list and remove its attached projects.\n\nSave the service account credentials as: $HOME/killbill_credentials.json\n\nPublish a test message\n======================\n\nPublish a fake notification under topic 'budget-alerts' for account 'capped-account':\n\n    export GOOGLE_APPLICATION_CREDENTIALS=$HOME/killbill_credentials.json\n    killbill-pub main-project budget-alerts capped-account\n\nConsume the test message\n========================\n\nConsume notifications from subscription 'killbill-queue'.\n\nExpected result is: All projects linked to account 'capped-account' should be detached from it.\n\nCAUTION: All **accounts** found in notifications sent to subscription 'killbill-queue' will be detached from all their projects. All those unlinked projects will stop, their services will be interrupted, their data will be lost. You can limit damage by granting project OWNER permisson to the IAM service account only on projects you can safely destroy.\n\n    export GOOGLE_APPLICATION_CREDENTIALS=$HOME/killbill_credentials.json\n    killbill main-project killbill-queue\n\ngcloud cli recipes\n==================\n\nSome gcloud cli recipes.\n\n    # publish message to topic\n    gcloud pubsub topics publish projects/PROJECT/topics/TOPIC --attribute=\"billingAccountId=000000-111111-222222\"\n\n    # delete subscription\n    gcloud pubsub subscriptions delete projects/PROJECT/subscriptions/SUBSCRIPTION\n\n    # create subscription\n    gcloud pubsub subscriptions create --topic=projects/PROJECT/topics/TOPIC SUBSCRIPTION\n\n\n-x-\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fgcpkillbilling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudhos%2Fgcpkillbilling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudhos%2Fgcpkillbilling/lists"}