http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
There are a few limitations that you need to be aware of and this includes:
- You can only use up to 5 layers per Lambda.
- The size of all your layers unzipped cannot exceed 250mb.
- Layers are mounted to the /opt directory in the function’s execution environment so be sure to Layer your functions properly if you are going to have more than one.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[email protected] | |
DOMAINS=example.com,www.example.com,foo.example.com,example.org.example.net,www.example.org,www.example.net | |
git clone https://github.com/letsencrypt/letsencrypt | |
cd letsencrypt/ | |
mkdir -p /var/lib/letsencrypt/global-webroot | |
# Setup the global alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import boto3 | |
def get_paginated_results(product, action, key, credentials=None, args=None): | |
args = {} if args is None else args | |
return [y for sublist in [x[key] for x in boto3.client(product, **({} if credentials is None else credentials)).get_paginator(action).paginate(**args)] for y in sublist] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for region in `aws ec2 describe-regions --query 'Regions[].RegionName' --output text`; do | |
aws sns list-subscriptions --query "Subscriptions[?starts_with(Endpoint, 'arn:aws:sqs:')].[TopicArn, Endpoint]" --output text --region $region | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A script to create a daily mysqldump for crashplan | |
# Defaults | |
# Override them in /etc/default/mysqlbackupforcrashplan | |
OUTPUTFILE=/var/local/full-backup.sql | |
STATEFILE=/var/local/full-backup.sql.state | |
CRONFILE=/etc/cron.d/mysqlbackupforcrashplan | |
MYSQLDUMPBIN=/usr/bin/mysqldump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for bucket in `cat list-of-s3-buckets.txt`; do | |
aws s3api put-bucket-lifecycle \ | |
--bucket $bucket \ | |
--lifecycle-configuration '{"Rules":[{"ID":"cleanup","Status":"Enabled","Prefix":"","Expiration":{"Days":1}}]}'; | |
done |
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/