Skip to content

Instantly share code, notes, and snippets.

View mcalhoun's full-sized avatar

Matt Calhoun mcalhoun

  • Jersey Shore, New Jersey, USA
  • 11:24 (UTC -04:00)
  • X @mdcalhoun
View GitHub Profile
@mcalhoun
mcalhoun / APIGatewayApproach.MD
Last active November 28, 2017 01:11
API Gateway Approach

Overview

We had several goals in mind as we evaluated the various solutions:

  1. use API Gateway
  2. use Lambda
  3. have a way to test locally
  4. have a way to deploy to prod while managing everything as code
  5. integrate with existing Terraform infra.

Many of these items have point solutions, but there isn't a comprehensive solution that doesn't require a lot of copy/paste and extra verbosity. For example, you can achieve #1, #2 and #3 with Serverless Application Model (SAM), but you have to maintain two sets of "mappings", one in swagger and one in SAM template language. And creating an API Gateway by hand in Terraform is exremely verbose, often requiring 5 or 6 stanzas to define one simple GET /foo endpoint.

We also need to create a role and a policy for Datadog Access

DatadogAWSIntegrationPolicy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "autoscaling:Describe*",

Keybase proof

I hereby claim:

  • I am mcalhoun on github.
  • I am mcalhoun (https://keybase.io/mcalhoun) on keybase.
  • I have a public key whose fingerprint is CFE0 BA2F 59AF 5CD4 37F0 EA63 8762 9663 2340 10B4

To claim this, I am signing this object:

EXCLUDEFILE=/tmp/exclude.file
EXCLUDELIST='/boot /etc/fstab /etc/hostname /etc/issue /etc/hosts /etc/sudoers /etc/networks /etc/network/* /etc/resolv.conf /etc/ssh/* /etc/sysctl.conf /etc/mtab /etc/udev/rules.d/* /lock /net /tmp /var/cache/xenstore /opt/nimsoft'
EXCLUDEPATH=$(echo $EXCLUDELIST | sed 's/\ /\\n/g')
echo -e $EXCLUDEPATH > $EXCLUDEFILE
service apache2 stop
service activemq stop
service mysql stop
service mongod stop
@mcalhoun
mcalhoun / bash.sh
Created November 2, 2015 18:43
Show crontab for all users
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@mcalhoun
mcalhoun / WinSCP Example
Created November 2, 2015 14:50
Example Using WinSCP to copy file to ftp2.datavail.com
C:\Users\mcalhoun\Downloads\winscp575>winscp.com /script=commands.txt
@mcalhoun
mcalhoun / create_gitkeep.sh
Created October 28, 2015 22:20
Create .gitkeep files recursively in all empty directories
find . -type d -empty -not -path "./.git/*" -exec touch '{}'/.gitkeep \;