{"id":22712204,"url":"https://github.com/buildit/aws-resource-tagging","last_synced_at":"2025-09-03T03:37:14.660Z","repository":{"id":78235619,"uuid":"94237869","full_name":"buildit/aws-resource-tagging","owner":"buildit","description":"Serverless project to automatically tag aws resources.","archived":false,"fork":false,"pushed_at":"2017-07-10T19:49:29.000Z","size":90,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-04T23:31:49.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buildit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-06-13T17:12:20.000Z","updated_at":"2018-06-05T16:30:43.000Z","dependencies_parsed_at":"2023-03-20T09:31:31.120Z","dependency_job_id":null,"html_url":"https://github.com/buildit/aws-resource-tagging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Faws-resource-tagging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Faws-resource-tagging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Faws-resource-tagging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buildit%2Faws-resource-tagging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buildit","download_url":"https://codeload.github.com/buildit/aws-resource-tagging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246250087,"owners_count":20747293,"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":[],"created_at":"2024-12-10T13:09:39.952Z","updated_at":"2025-03-29T22:21:48.503Z","avatar_url":"https://github.com/buildit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"AWS Resource Tagging\n====================\nMeta\n----\nAutomatically tags aws resources on create with user ARN.  Resources to tag are identified\nby CloudTrail-generated CloudWatch Events, thus you need to have CloudTrail enabled in your \naccount.\n\nEvents flow as follows:\n\n```\nCloudTrail -\u003e CloudWatch Events -\u003e SNS -\u003e Lambda\n```\n\nThe Serverless framework is used to build and deploy necessary resources. \n\nGiven that you have CloudTrail enabled, the CloudWatch Events filter, SNS topic, and Lambda\nfunction are all created for you by this project.\n \n\nCurrently supports the following events:\n\n- EC2\n    - RunInstances\n    - CreateNetworkInterface\n    - CreateInternetGateway\n    - CreateRouteTable\n    - CreateSubnet\n    - CreateVpc\n- Etc\n    - CreateBucket\n    - CreateFunction20150331\n\n\nDocker (cleanroom) Deployment (and Development, if you like)\n-----------------------------\nA Dockerfile is provided.  By using Docker we remove the need to install any global dependencies \non the host. In this case Java 8, NodeJS, the serverless framework, Python and the AWS CLI.\n\n- `docker build --tag sls-tagging .`\n- `docker run -itv $(pwd):/src sls-tagging`\n- `aws configure`\n- `cd /src`\n- `./gradlew build`\n- `sls deploy --region \u003cdeployment region\u003e` (to your development/test region)\n\n(or you can install the stuff mentioned in the Dockerfile in your host environment and work there, if you like)\n\n\nDevelopment\n-----------\n\nThe solution was written using Java 8, and uses a simple \"by convention\" method of constructing instances to handle \ndifferent CloudWatch Event types.\n\nTo add tagging for more resource types:\n\n- In Java code\n  - Implement an appropriate `ResourceIdExtractor`.  Follow the convention `\u003cEvent Name\u003eIdExtractor`.  \n    A convenience abstract implementation is provided: `AbstractResourceIdExtractor`, which uses `JsonPath` to pull out the ID element(s).\n\n     Currently, these implementations must be packaged with the other `ResourceIdExtractor` implementations.\n  - Implement an appropriate `Tagger`.  Follow the convention `\u003cEvent Name\u003eTagger`.  \n    A `Tagger` implementation uses the AWS API to tag resources identified by its associated `IDExtractor`.\n\n     Like `ResourceIdExtractor`s, these implementations must be packaged with the other `Tagger` implementations.\n\n- In serverless.yml\n  - Add the necessary permissions to `iamRoleStatements` \n  - Update the CloudWatch `EventPattern` with `source` \u0026 `eventName` \n  \n\nImplementation Notes\n--------------------\nThe \"by convention\" approach to finding implementors is a simplistic reflection-based solution.  There is an \nalternative annotation-based approach checked in, but it is half-baked and not DRY at the moment.  Thus, the \ncode currently uses the reflective approach.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Faws-resource-tagging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildit%2Faws-resource-tagging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildit%2Faws-resource-tagging/lists"}