Infrastructure-base
|- foundation-roles/
|- resources/
| |- cloudtrail.yaml
| |- s3.yaml
|- vpc/
| |- vpc-complete.yaml
|- logging/
| |- functions
This file contains hidden or 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 bash | |
| # Example: | |
| # ./find-ecr-image.sh foo/bar mytag | |
| if [[ $# -lt 2 ]]; then | |
| echo "Usage: $( basename $0 ) <repository-name> <image-tag>" | |
| exit 1 | |
| fi | |
| IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )" |
This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "regexp" | |
| "strconv" | |
| ) | |
| func main() { |
This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "net/http" | |
| "os" |
This file contains hidden or 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 | |
| GREEN='\x1B[32m' | |
| RED='\x1B[31m' | |
| NOCOL='\x1B[39m' | |
| echo "${GREEN}Removing exited containers${NOCOL}" | |
| docker rm -v $(docker ps --filter status=dead --filter status=exited -aq) | |
| echo "${GREEN}Removing dangling images${NOCOL}" | |
| docker rmi $(docker images -f "dangling=true" -q) |
This file contains hidden or 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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: AWS::Serverless-2016-10-31 | |
| Description: Sample SAM Template for AWS lambda in vpc | |
| Resources: | |
| NatEIP: | |
| Type: AWS::EC2::EIP | |
| Properties: | |
| Domain: vpc |
This file contains hidden or 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
| class AttachedValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| record.errors.add(attribute, :attached, options) unless value.attached? | |
| end | |
| end |
This file contains hidden or 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
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: Deploys a basic httpd hello world app in an EC2 instance, create and attach a security group for the instance | |
| Mappings: | |
| Infra: | |
| Vpcs: | |
| Main: vpc-xxxx | |
| Subnets: | |
| Public: |
This file contains hidden or 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
| packages: | |
| yum: | |
| newrelic-sysmond: [] | |
| rpm: | |
| newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm | |
| commands: | |
| "01": | |
| command: nrsysmond-config --set license_key=LICENSE_KEY | |
| "02": | |
| command: echo hostname=`aws ec2 describe-tags --filters "Name=resource-id,Values=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" "Name=key,Values=elasticbeanstalk:environment-name" --region=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) --output=json | jq -r '.Tags[0].Value +"-"+ .Tags[0].ResourceId'` >> /etc/newrelic/nrsysmond.cfg |
This file contains hidden or 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
| (function (document) { | |
| 'use strict'; | |
| var webpImg = new Image(); | |
| webpImg.onerror = function() { | |
| setModernizr(false); | |
| } | |
| webpImg.onload = function(){ | |
| var root = document.getElementsByTagName('html')[0]; | |
| if (root.classList) { |