https://github.com/eheydrick/ebsautotagger
AWS Lambda function to tag EBS volumes created by autoscaling
https://github.com/eheydrick/ebsautotagger
aws ebs ec2 lambda tags
Last synced: 4 months ago
JSON representation
AWS Lambda function to tag EBS volumes created by autoscaling
- Host: GitHub
- URL: https://github.com/eheydrick/ebsautotagger
- Owner: eheydrick
- License: mit
- Created: 2018-03-06T20:27:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T00:41:44.000Z (over 8 years ago)
- Last Synced: 2025-06-28T06:45:26.332Z (12 months ago)
- Topics: aws, ebs, ec2, lambda, tags
- Language: HCL
- Homepage:
- Size: 3.91 KB
- Stars: 18
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ebsautotagger
Tag EBS volumes created by autoscaling.
Currently there is no way for EC2 autoscaling to tag EBS volumes when they are
created. The ebsautotagger lambda function will automatically add tags to EBS
volumes as autoscaling launches the instances. A [Cloudwatch Events](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html)
rule is used to invoke the lambda. It will tag all non-root EBS volume with the
tags you specify in the lambda function.
## Usage
You will most certainly need to adjust the lambda function to meet your needs. The
example function will add a few sample tags. It looks for an instance tag called
`service` with a value defined in the environment variable `SERVICE_TAG_VALUE`.
You will want to adjust this for your environment or replace it with something that
makes more sense for you.
The `terraform` directory contains terraform code that sets everything up. This
terraform will do the following:
1. Deploy lambda function
1. Create Cloudwatch Rule that invokes the lambda function when autoscaling
launches instances.
1. Create all the required IAM permissions