{"id":23252429,"url":"https://github.com/devwithkrishna/azure-terraforminator","last_synced_at":"2025-04-06T02:44:30.023Z","repository":{"id":267335341,"uuid":"862451384","full_name":"devwithkrishna/azure-terraforminator","owner":"devwithkrishna","description":" A pipeline to delete unused resources in azure based on a specific tag","archived":false,"fork":false,"pushed_at":"2025-03-27T19:53:28.000Z","size":22,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T20:29:54.786Z","etag":null,"topics":["azure-sdk-for-python","cron","poetry","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/devwithkrishna.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":"2024-09-24T16:11:32.000Z","updated_at":"2025-03-27T19:53:08.000Z","dependencies_parsed_at":"2025-02-07T19:34:06.696Z","dependency_job_id":null,"html_url":"https://github.com/devwithkrishna/azure-terraforminator","commit_stats":null,"previous_names":["devwithkrishna/azure-terraforminator"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-terraforminator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-terraforminator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-terraforminator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devwithkrishna%2Fazure-terraforminator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devwithkrishna","download_url":"https://codeload.github.com/devwithkrishna/azure-terraforminator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426984,"owners_count":20937197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["azure-sdk-for-python","cron","poetry","python","python3"],"created_at":"2024-12-19T10:16:34.157Z","updated_at":"2025-04-06T02:44:29.998Z","avatar_url":"https://github.com/devwithkrishna.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure-terraforminator\n A pipeline to delete unused resources in azure based on a specific tag\n\n[![azure-decommision-unsed-resource-groups-with-temporary-tag-as-true](https://github.com/devwithkrishna/azure-terraforminator/actions/workflows/azure-terraforminator.yaml/badge.svg)](https://github.com/devwithkrishna/azure-terraforminator/actions/workflows/azure-terraforminator.yaml)\n\n# What this does\n\n* Reducing cloud costs and decommissioning unused resources are essential practices for efficient cloud management. \n\n#### Cost Savings\n* Pay-as-you-go model: Cloud services charge based on resource usage, so any unused or idle resources still incur costs. Decommissioning these saves money that can be allocated elsewhere.\n* Hidden costs: Over-provisioned or forgotten services like unused VMs, storage, or databases can rack up unexpected costs over time.\n#### Resource Optimization\n* Avoid over-provisioning: Scaling down unused or underutilized resources ensures you're only paying for what you need, preventing waste.\n* Better performance: By right-sizing resources, you allocate appropriate computing power to services, improving overall performance.\n#### Improved Security\n* Minimize attack surface: Decommissioning unused resources reduces potential vulnerabilities that could be exploited by attackers.\n* Avoid data leakage: Retiring unnecessary storage or services prevents accidental exposure of sensitive data.\n#### Operational Efficiency\n* Simplified management: Fewer resources mean less administrative overhead in terms of monitoring, patching, and maintenance.\n* Compliance and governance: Removing outdated or unnecessary assets helps maintain compliance with regulatory standards, as only necessary resources are active\n\n\n### This is defined in a way that it decommisions a resource group based on a specific tag in azure. When the autmation finds `Temporary` tag wth Value as `TRUE` it decommisions.\n\n\n#### For the automation to work we needd a service principal which has access to the subscription level atleast with contributor permission as deletion of resources are involved.\n\n#### Configure the below environment variables as GitHub secrets\n\n```markdown\nAZURE_CLIENT_ID = \"value\"\nAZURE_CLIENT_SECRET = \"value\"\nAZURE_TENANT_ID = \"value\"\n```\n\n* The code is using python with poetry as package management tool\n\n* This job is set to run as a cron every day and as a manual trigger as well if necessary\n\n```markdown\n\nThis is a sample of output showing what are the resources deleted\n\nThe below resources are decommisioned on \u003cDate : yyyy-mm-dd\u003e\n+------------------------+-----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+\n| Name                   | Type                              | ID                                                                                                                                                 | Resource Group Name   |\n+========================+===================================+====================================================================================================================================================+=======================+\n| Name of resource   | Type | Resource Id   | Rg name          |\n+------------------------+-----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+\n| mystorageaccountswswwe | Microsoft.Storage/storageAccounts | /subscriptions/es271149ae-05d3-4dcsssf-b946-d71f3f39/resourceGroups/ARCHITECTS-3/providers/Microsoft.Storage/storageAccounts/mystorageaccountswswwe | ARCHITECTS-3          |\n+------------------------+-----------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkrishna%2Fazure-terraforminator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevwithkrishna%2Fazure-terraforminator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevwithkrishna%2Fazure-terraforminator/lists"}