Skip to content

Instantly share code, notes, and snippets.

@sredhar
sredhar / gist:7516666
Last active December 28, 2015 14:39
Mail
{
"AWSTemplateFormatVersion" : "2013-11-07",
"Description" : "AWS CloudFormation Template for mail. Creates a Auto Scaling group of web tier with load balancer, RDS and Elasticache cluster.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing Amazon EC2 KeyPair for SSH access to the Web Server",
"Type" : "String"
@sredhar
sredhar / gist:7125981
Created October 23, 2013 20:20
Release unused elastic IPs
import boto
import boto.ec2
conn = boto.connect_ec2()
eips = conn.get_all_addresses()
for eip in eips:
if eip.association_id is None:
try:
@sredhar
sredhar / EC2RunInstancePolicy
Created September 18, 2013 01:32
Policy Generator for launching instances from a EC2 Instance.
{
"Statement": [
{
"Sid": "EC2RunInstancePolicy",
"Action": [
"ec2:RunInstances",
"ec2:DescribeInstances",
"ec2:DescribeKeyPairs",
"ec2:DescribeImages",
"ec2:CreateTags",
@sredhar
sredhar / S3 Bucket RW
Last active December 22, 2015 13:49
S3 Bucket RW Policy
# Sourced from http://samwize.com/2013/04/21/s3cmd-broken-pipe-error-errno-32/
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:ListAllMyBuckets",
"s3:ListBucketMultipartUploads"