Skip to content

Instantly share code, notes, and snippets.

@Deathjam
Deathjam / lambdaAMIBackups.py
Created May 10, 2019 14:49 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Automated AMI Backups
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
@Deathjam
Deathjam / lambdaAMICleanup.py
Last active December 20, 2023 22:49 — forked from bkozora/lambdaAMICleanup.py
AWS Lambda Function to Delete AMIs and Snapshots
# Automated AMI and Snapshot Deletion
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and reference the AMIs of that instance. We check that the latest daily backup
# succeeded then we store every image that's reached its DeleteOn tag's date for
# deletion. We then loop through the AMIs, deregister them and remove all the
# snapshots associated with that AMI.
@Deathjam
Deathjam / setup-volume.ps1
Created April 24, 2018 15:00 — forked from anderssonjohan/setup-volume.ps1
user data script to initialize, partition and format ebs volume /dev/xvd[drive letter]
function setup-volume {
param(
[parameter(mandatory=$true,helpmessage="drive letter")]
[string] $driveletter,
[parameter(mandatory=$false,helpmessage="file system label")]
[string] $label = ""
)
$driveletter = $driveletter.ToLower()
{
"title": "Apache logs",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,