Collection of scripts and lambda functions used for maintaining AWS
Lambda function which monitors CloudTrail logs and sends SNS notification on
LaunchInstances event. This can be modified to look for and respond to any AWS API calls as needed.
infrastructure/templates/cloudtrail-notifications.json CloudFormation template to create the Lambda, CloudTrail and SNS topics. In the Outputs of the CloudFormation
stack, you'll find the SNS topic to which you can subscribe to receive the notifications.
Lambda function used to copy RDS snapshot from eu-west-1 (Ireland) to eu-central-1 (Frankfurt). One (latest) copy for each RDS instance is kept in Frankfurt.
clean-base-images.py and clean-release-images.py
Remove AMIs from eu-west-1 (Ireland) to eu-central-1 (Frankfurt) based on different tags.
Meant to be used as a part of immutable infrastructure, where each project has a base AMI (tagged with
each release in contained within a new AMI based on it (tagged with
- base images are stored in Ireland. Release images are stored in Ireland and Frankfurt (as backups).
- Apart from
Typetag, each AMI has a
Projecttag, which can contain any value.
Those scripts make sure only a certain amount of recent images for each project is stored to limit the costs.
Removes old CloudWatch indices inside AWS ElasticSearch Service. Useful when using CloudWatch log streaming into ElasticSearch.
Configure list of accounts, ElasticSearch endpoint and amount of last indices to be kept inside the code.