https://github.com/twin/aws-eks-auto-tagger
Automatically tags EBS volumes created by Persistent Volumes within an AWS EKS cluster
https://github.com/twin/aws-eks-auto-tagger
auto-tagger auto-tagging aws ebs ebs-volumes eks hacktoberfest k8s persistent-volume persistent-volumes tagging
Last synced: 4 months ago
JSON representation
Automatically tags EBS volumes created by Persistent Volumes within an AWS EKS cluster
- Host: GitHub
- URL: https://github.com/twin/aws-eks-auto-tagger
- Owner: TwiN
- License: mit
- Created: 2020-08-19T18:07:53.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T01:35:57.000Z (over 3 years ago)
- Last Synced: 2025-02-01T11:34:45.409Z (4 months ago)
- Topics: auto-tagger, auto-tagging, aws, ebs, ebs-volumes, eks, hacktoberfest, k8s, persistent-volume, persistent-volumes, tagging
- Language: Go
- Homepage:
- Size: 669 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# aws-eks-auto-tagger
[](https://cloud.docker.com/repository/docker/twinproduction/aws-eks-auto-tagger)
[](https://goreportcard.com/report/github.com/TwiN/aws-eks-auto-tagger)Automatically tags all EBS volumes that are tagged with
```
kubernetes.io/cluster/$CLUSTER_NAME: owned
```There's no way to automatically add one or multiple tags to an EBS that was created by a PersistentVolume.
By leveraging the aforementioned default tag, this application is able to iterate over all EBS volumes that are owned by the cluster and add one or multiple tags to each EBS volume.## Environment variables
| Key | Description | Default value |
| ---------------------------------- | ----------- | ------------- |
| `TAG_` | Tag to add to the resources. The tag name will be the name of the variable stripped of the `TAG_` prefix and the tag value will be the value assigned to the variable | N/A |
| `CLUSTER_NAME` | Name of the EKS cluster. Used to search for EBS volumes that belong to the cluster (i.e. by looking for the tag `kubernetes.io/cluster/$CLUSTER_NAME: owned`) | `""` required |
| `AWS_REGION` | Name of AWS region. | `""` required |
| `EBS_TAGGING_ENABLED` | Whether to automatically tag EBS volumes or not | `true` |
| `OVERWRITE_IF_DIFFERENT_TAG_VALUE` | Whether to overwrite the tag if it already exists, but with a different value | `false` |
| `EXECUTION_INTERVAL_IN_MINUTES` | Time to wait between each run in minutes | `10` |## Permissions
To function properly, this application requires the following permissions on AWS:
- ec2:CreateTags
- ec2:DescribeVolumes## Developing
Make sure to set the required environment variables, and consider whether you want
the EBS Volumes to be tagged or not.
If you just want to test it, you can set `EBS_TAGGING_ENABLED` to `false`, and the creation of the tags will be skipped.Your local aws credentials must also be valid (i.e. you can use `awscli`)