Skip to content

Instantly share code, notes, and snippets.

View przygode's full-sized avatar

Katherine Przygode przygode

View GitHub Profile
@przygode
przygode / gist:3970769
Created October 29, 2012 00:54
metadata data for ChefClient
{
"ChefClient": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"DependsOn": "BucketPolicy",
"Metadata": {
"AWS::CloudFormation::Init": {
"config": {
"packages": {
"rubygems": {
"chef": [
@przygode
przygode / gist:3970766
Created October 29, 2012 00:53
chefclient properties
"Properties": {
"SecurityGroups": [ { "Ref": "AppServerAccess" } ],
"ImageId": {
"Fn::FindInMap": [
"AWSRegionArch2AMI",
{ "Ref": "AWS::Region" },
{ "Fn::FindInMap": [
"AWSInstanceType2Arch",
{ "Ref": "InstanceType" },
"Arch"
@przygode
przygode / gist:3970735
Created October 29, 2012 00:47
chefclient chef_init.rb
#!/usr/bin/ruby
#
#Setup chef client.
#
domain_name = ARGV[0]
environment = ARGV[1]
organization = ARGV[2]
fqdn = `curl http://169.254.169.254/latest/meta-data/hostname`.split(".")
@przygode
przygode / gist:3928592
Created October 21, 2012 21:36
auto-scaling-loadbalancer
{
"app.stratalux.com": {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"AvailabilityZones": {
"Fn::GetAZs": ""
},
"HealthCheck": {
"HealthyThreshold": "10",
"Interval": "15",
@przygode
przygode / gist:3928588
Created October 21, 2012 21:33
auto-scaling AppServerGroup
{
"AppServerGroup": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": {
"Fn::GetAZs": ""
},
"LaunchConfigurationName": {
"Ref": "ChefClient"
},
@przygode
przygode / gist:3928545
Created October 21, 2012 21:21
auto-scaling-parameters
{
"Parameters": {
"KeyName": {
"Type": "String",
"Description": "Name of an existing EC2 Key Pair to enable SSH access to the webserver",
"Default": "AWS_SSH_KEY"
},
"InstanceType": {
"Description": "Application Server EC2 instance type",
"Type": "String",
@przygode
przygode / gist:3925522
Created October 21, 2012 02:41
auto-scaling complete configuration
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AppServer Stack",
"Parameters": {
"KeyName": {
"Type": "String",
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the web server",
"Default": "AWS_SSH_KEY"
},
"InstanceType": {
@przygode
przygode / gist:3759883
Created September 21, 2012 05:31
auto-scaling-waitcondition
{
"ChefClientWaitHandle": {
"Type": "AWS::CloudFormation::WaitConditionHandle"
},
"ChefClientWaitCondition": {
"Type": "AWS::CloudFormation::WaitCondition",
"DependsOn": "ChefClient",
"Properties": {
"Handle": {
"Ref": "ChefClientWaitHandle"
@przygode
przygode / gist:3759875
Created September 21, 2012 05:29
auto-scaling-CPUAlarmLow
{
"CPUAlarmLow": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Scale-down if CPU < 75% for 10 minutes",
"MetricName": "CPUUtilization",
"Namespace": "AWS/EC2",
"Statistic": "Average",
"Period": "60",
"EvaluationPeriods": "10",
@przygode
przygode / gist:3759868
Created September 21, 2012 05:25
auto-scaling-CPUAlarmHigh
{
"CPUAlarmHigh": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Scale-up if CPU > 75% for 10 minutes",
"MetricName": "CPUUtilization",
"Namespace": "AWS/EC2",
"Statistic": "Average",
"Period": "60",
"EvaluationPeriods": "10",