Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View flomotlik's full-sized avatar

Florian Motlik flomotlik

View GitHub Profile
@flomotlik
flomotlik / Dockerfile
Created September 18, 2017 13:35
AWSGit for pushing to CodeCommit
FROM alpine:latest
RUN apk add --no-cache --update \
python \
python-dev \
py-pip \
build-base \
git
RUN pip install awscli
@flomotlik
flomotlik / service-checklist.md
Created March 20, 2017 14:20 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@flomotlik
flomotlik / functions.sh
Created September 28, 2016 11:22
Pull Request handling
# Checkout a PR from the current repo
function copr { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }
# Get the current PR from the branch name
function current_pr {
git rev-parse --abbrev-ref HEAD | grep -oE "\d+"
}
# Update the PR
function upr {

Setting the AWS API Key & Secret

To start using Serverless and access the AWS API you need to set the AWS API Access Key & Secret.

Quick Setup

As a quick setup to get started you can export them as environment variables so they will be accessible to Serverless and the AWS SDK in your shell:

export AWS_ACCESS_KEY_ID=<key>
export AWS_SECRET_ACCESS_KEY=<secret>
module exports = class SomePlugin extends ServerlessPlugin{
//Contructor should be defined in ServerlessPlugin so you don't have to recreate it here
constructor(pluginConfig, serverlessConfig, serverlessUtils) {
this.pluginConfig = pluginConfig;
this.serverlessConfig = serverlessConfig;
this.serverlessUtils = serverlessUtils;
}
beforeDeployResources(params) {
@flomotlik
flomotlik / Public_Key.asc
Created July 20, 2015 08:58
Codeship PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mQINBFWstgkBEADCEqXKz83rIAK6VLaaqNJ09RNcTxMW0eOJu12/5bthFXnhVOQb
B1n4UMFxlHAFK9IOXwfmMsU4z8z8I7oDlfkRRyGRoQAoxuUuxYZTeWnGFktnRtRQ
G3SXzXmLkIgajd7jksPzQxySWf4/4CUa2DiyUhm0vhC/63BGRxf6uU9Vn9FwRg+o
cqeXHWdffvbcguAJe2aFCHHAg4fS0usiqTPPHhCWaOicmoJ0HjkWmWDJB8Mq/b1C
EQL/tsMBBfMo2TsolBWYoYvqEaeGO7N2Dj/leHq0JjN60pLV4Ggnq3RXqHvFX+4r
B7bg9tBi5fCSHNYFpF5/9+rya8M5wvJvfZqfS36K0ft4La8orb/8MizQdCveP/xG
r8CkpWrxRGNmcUETVZZl8StCnEIW7ONYAdScjDv/SFhzhuz+XvNZuvwFtUsU4LmZ
function docker_cleanup {
# Find all containers that have exited
containers=`docker ps -a -q | xargs`
if [[ $containers ]]; then
# Remove exited containers
docker stop $containers
docker rm $containers
else
echo "No containers to remove"
fi
@flomotlik
flomotlik / debrief-template
Last active May 5, 2016 16:22
Codeship Debrief Template
# Service Interruption Debrief
## Brief Executive Summary
EXECUTIVE SUMMARY HERE
***On Call during outage***:
***Time outage started***:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:RegisterApplicationRevision",
"codedeploy:GetApplicationRevision"
],
"Resource": [
@flomotlik
flomotlik / CodeDeploy policy
Last active August 29, 2015 14:14
CodeDeploy policies
#Link to CodeDeploy IAM details: http://docs.aws.amazon.com/codedeploy/latest/userguide/access-permissions.html
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codedeploy:RegisterApplicationRevision",