Skip to content

Instantly share code, notes, and snippets.

@zenmaster24
zenmaster24 / ebs-snapshot.py
Created June 28, 2017 01:54
Python Lambda to create snapshots of all ebs volumes attached to an instance if it has the tag 'snapshot:yes'
import boto3
import json
import datetime
import time
ec2 = boto3.resource('ec2', region_name='ap-southeast-2')
filters = [{
'Name': 'tag:snapshot',
'Values': [ 'yes' ]
}]
@zenmaster24
zenmaster24 / snapshot.py
Created May 4, 2017 23:32
basic lambda for creating a snapshot of all volumes attached to an instance with tag "snapshot:yes"
import boto3
import json
import datetime
import time
ec2 = boto3.resource('ec2', region_name='ap-southeast-2')
filters = [{
'Name': 'tag:snapshot',
'Values': [ 'yes' ]
}]