Skip to content

Instantly share code, notes, and snippets.

Kevin Karwaski kevinkarwaski

Block or report user

Report or block kevinkarwaski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View codepipeline-example.yml
---
AWSTemplateFormatVersion: '2010-09-09'
Description: My example codepipeline template
# ------------------------- #
# CloudFormation Parameters #
# ------------------------- #
Parameters:
View codebuild-pr-example.yml
AWSTemplateFormatVersion: "2010-09-09"
Description: My example codebuild template for pull requests
Parameters:
VPCStackName:
Type: AWS::SSM::Parameter::Value<String>
Default: /cloudformation/parameters/vpc/stackname
Description: The name of the parent VPC networking stack that you created. Necessary
to locate and reference resources created by that stack.
View codebuild-buildspec-react-example.yml
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- echo Installing app dependencies...
- yarn install
build:
View fargate-service-template.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Deploy a service on AWS Fargate, hosted in a private subnet.
Parameters:
ENV:
Description: Name of the environment
Type: AWS::SSM::Parameter::Value<String>
Default: /cloudformation/parameters/env
@kevinkarwaski
kevinkarwaski / ShowAllFiles
Created May 10, 2019
Control dot/hidden file visibility in OSX from the command line
View ShowAllFiles
# Show dot/hidden files in the OXS Finder
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
# Hide dot/hidden files in the OXS Finder
defaults write com.apple.finder AppleShowAllFiles False
killall Finder
View install-jet.sh
#!/usr/bin/env bash -e
# Install Codeship's JET cli tool for Docker on OSX (brew-less).
# https://codeship.com/documentation/docker/installation/#mac-os-x
# https://codeship.com/documentation/docker/release-notes/
JET_VERSION=1.9.3
FILE_NAME=jet-darwin_amd64_${JET_VERSION}.tar.gz
CHECKSUM=sha256sums
View asg-graceful-lifecycle-termination.py
import boto3
import json
import logging
import time
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def notify_on_error(message):
View cf-asg-lambda-sns.json
"MyLambdaLifecycleFunction": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Handler": "asg-graceful-lifecycle-termination.lambda_handler",
"Role": { "Fn::GetAtt" : ["LambdaExecutionRole", "Arn"] },
"Code": {
"S3Bucket": "lambda-functions",
"S3Key": "asg-graceful-lifecycle-termination.zip"
},
"Runtime": "python2.7",
View cf-sns-lifecycle-topic.json
"myLifecycleHookTopic" : {
"Type" : "AWS::SNS::Topic",
"Properties" : {
"Subscription" : [
{ "Endpoint" : { "Fn::GetAtt" : [ "MyLambdaLifecycleFunction", "Arn" ] }, "Protocol" : "lambda" }
]
}
}
"myLifecycleHook": {
View cf-asg-lifecycle-hook.json
"myLifecycleHook": {
"Type": "AWS::AutoScaling::LifecycleHook",
"Properties": {
"AutoScalingGroupName": { "Ref": "myAutoScalingGroup" },
"HeartbeatTimeout": 300,
"LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING",
"NotificationMetadata": { "Ref": "StackName" },
"NotificationTargetARN": { "Ref": "lifecycleHookTopic" },
"RoleARN": { "Fn::GetAtt": [ "lifecycleHookRole", "Arn" ] }
}
You can’t perform that action at this time.