{"id":18866401,"url":"https://github.com/nordcloud/azure-tag-manager","last_synced_at":"2025-04-14T14:31:09.600Z","repository":{"id":35472273,"uuid":"198033212","full_name":"nordcloud/azure-tag-manager","owner":"nordcloud","description":"Azure Tag Manager, enforce tags at scale.","archived":false,"fork":false,"pushed_at":"2023-06-05T15:57:33.000Z","size":150,"stargazers_count":21,"open_issues_count":6,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-28T03:24:55.889Z","etag":null,"topics":["azure","azure-resource-manager","azure-resources","azure-tags-remediation"],"latest_commit_sha":null,"homepage":"https://medium.com/nordcloud-engineering","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/nordcloud.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":"2019-07-21T08:40:53.000Z","updated_at":"2024-07-10T03:10:45.000Z","dependencies_parsed_at":"2024-06-19T02:54:06.121Z","dependency_job_id":"90964f62-2aeb-46e6-985a-29fda8f98fb4","html_url":"https://github.com/nordcloud/azure-tag-manager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fazure-tag-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fazure-tag-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fazure-tag-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Fazure-tag-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/azure-tag-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248897085,"owners_count":21179534,"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","azure-resource-manager","azure-resources","azure-tags-remediation"],"created_at":"2024-11-08T05:06:26.533Z","updated_at":"2025-04-14T14:31:09.227Z","avatar_url":"https://github.com/nordcloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://dev.azure.com/dariuszdwornikowski0297/azure-tag-manager/_apis/build/status/nordcloud.azure-tag-manager?branchName=master)](https://dev.azure.com/dariuszdwornikowski0297/azure-tag-manager/_build/latest?definitionId=1\u0026branchName=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nordcloud/azure-tag-manager)](https://goreportcard.com/report/github.com/nordcloud/azure-tag-manager)\n\n# Azure Tag manager \n\nTag manager is used to add or change tags on Azure resources on a massive scale. The tags are applied only when given rules are satisfied, for example prior existance of a certain tag, or the lack of it. \n\n## Download\n\nYou can download a binary for your architecture from the releases page. \n\n## Usage\n\nTo use it you need to create Azure service principal. Create service principal file:\n\n```bash\naz ad sp create-for-rbac --sdk-auth \u003e my.auth\n```\nand export path to the authorizer:\n\n```bash\nexport AZURE_AUTH_LOCATION=my.auth\n```\n\n`beta`: Using cli authorizer is in works.\n\n## How it works ?\n\nAzure Tag Manager needs a file with rules, each rule consists of conditions and actions. Given all the conditions, all actions are executed. The rules file can be supplied either in json or yaml. \n\n```json\n{\n  \"dryrun\": true,\n  \"rules\":  [\n    {\n        \"name\": \"Tag me stuff\", \n        \"conditions\": [\n            {\"type\": \"tagEqual\", \"tag\": \"myTag\", \"value\" : \"example\"},\n            {\"type\": \"tagExists\", \"tag\": \"myTagWhichExists\"},\n            {\"type\": \"tagNotExists\", \"tag\": \"env\"}\n        ], \n        \"actions\": [\n            {\"type\": \"addTag\", \"tag\": \"newTag\", \"value\": \"value\" },\n            {\"type\": \"addTag\", \"tag\": \"newTag2\", \"value\": \"value2\" }\n        ]\n      }\n    ]\n}\n```\n\nEquivalent of the same file in YAML would look like:\n\n```YAML\n---\ndryrun: true\nrules:\n- name: Tag me this\n  conditions:\n  - type: tagEqual\n    tag: myTag\n    value: example\n  - type: tagExists\n    tag: myTagWhichExists\n  - type: tagNotExists\n    tag: env\n  - type: regionEqual\n    region: westeurope\n  - type: rgEqual\n    resourceGroup: exampleRg\n  actions:\n  - type: addTag\n    tag:  newTag\n    value: newValue\n  - type: addTag\n    tag: newTag2\n    value: someValue\n```\n\nThe following types of conditions are accepted:\n\n* `noTags` - checks if there are no tags set \n* `tagEqual` - checks if a `tag` has a `value` set \n* `tagNotEqual` - checks if a `tag` has a value set different than `value` \n* `tagExists` - checks if a tag with key `tag` exists\n* `tagNotExists` - same as above but negative\n* `regionEqual` - checks if resource is in key `region` (aka location in azure)\n* `regionNotEqual` - same as above but negative\n* `rgEqual` - match resource group in a key `resourceGroup`\n* `rgNotEqual` - match not resource group\n* `resEqual` - resource name equals `resource` \n\nThe supported actions are:\n\n* `addTag` - adds a tag with key `tag` and value `value`\n* `delTag` - deletes a tag with key `tag`\n\nWhen rewriting, the tool will first do a backup of old tags. It will be saved in a file in the current (run) directory. \n\n## Running \n\nTagmanager accepts commands and flags: `tagmanager COMMAND [FLAGS`]. \n```\nUsage:\n  tagmanager [command]\n\nAvailable Commands:\n  check       Do sanity checks on a resource group (NOT FULLY IMPLEMENTED YET)\n  help        Help about any command\n  restore     Restore previous tags from a file backup\n  retagrg     Retag resources in a rg based on tags on rgs\n  rewrite     Rewrite tags based on rules from a file\n\nFlags:\n  -h, --help      help for tagmanager\n  -v, --verbose   verbose output\n```\n\nCommands:\n\n* `rewrite` - mode where tagmanager will retag the resources based on mapping given in a mapping file input (specified with `-m filepath` flag). If `--dry` flag is given, the tagging actions will not be executed\n\n* `restore` - restores tags backed up in a file, supplied by `-f filepath` flag\n\n* `check` - (EXPERIMENTAL) does some basic sanity checks on the resource group given as `--rg` flag \n\n* `retagrg` - Takes tags form a given resource group (`--rg`) and applies them to all of the resources in the resource group. If any existing tags are already there, the new ones with be appended. Adding `--cleantags` will clean ALL the tags on resources before adding new ones. \n\n## Todo \n\n* Azure ARM policy setting \n* AWS support for EC2\n\n## Licence \n\nMIT licence.\n\nAuthor(s): Dariusz Dwornikowski (@tdi)\n\nMade by Nordcloud in Poznań with ♥. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fazure-tag-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Fazure-tag-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Fazure-tag-manager/lists"}