- Run the following
pip install -r requirements.txt -t .vendor zip -r ../iview.zip .vendor lambda.py aws lambda update-function-code --function-name influx-count-instances --zip-file fileb://../iview.zip
- Set environment variables thusly, e.g.
Execute with the included IAM policy
Due to data requirements, developers need to spin up application and database instances in a special AWS account to be able to test their code. In order to contain costs, the SRE team needs to keep track of how many instances are running at any given time to make sure that we do not cross certain cost thresholds.
Create a Lambda function that can be run on a regular schedule (Cloudwatch Events) that get the number of EC2 Instances running in an account that have a specific tag and put the results in an InfluxDB.
Fork this repo to your personal GitHub account. After you have completed your function, email a link to your repository for review (an address will be provided to you). For convenience. , an InfluxDB Docker compose file is included to spin up the InfluxDB
What You Will Need
- A GitHub account
- AWS Account