This file contains 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
{ | |
"ChefClient": { | |
"Type": "AWS::AutoScaling::LaunchConfiguration", | |
"DependsOn": "BucketPolicy", | |
"Metadata": { | |
"AWS::CloudFormation::Init": { | |
"config": { | |
"packages": { | |
"rubygems": { | |
"chef": [ |
This file contains 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
"Properties": { | |
"SecurityGroups": [ { "Ref": "AppServerAccess" } ], | |
"ImageId": { | |
"Fn::FindInMap": [ | |
"AWSRegionArch2AMI", | |
{ "Ref": "AWS::Region" }, | |
{ "Fn::FindInMap": [ | |
"AWSInstanceType2Arch", | |
{ "Ref": "InstanceType" }, | |
"Arch" |
This file contains 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/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(".") |
This file contains 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
{ | |
"app.stratalux.com": { | |
"Type": "AWS::ElasticLoadBalancing::LoadBalancer", | |
"Properties": { | |
"AvailabilityZones": { | |
"Fn::GetAZs": "" | |
}, | |
"HealthCheck": { | |
"HealthyThreshold": "10", | |
"Interval": "15", |
This file contains 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
{ | |
"AppServerGroup": { | |
"Type": "AWS::AutoScaling::AutoScalingGroup", | |
"Properties": { | |
"AvailabilityZones": { | |
"Fn::GetAZs": "" | |
}, | |
"LaunchConfigurationName": { | |
"Ref": "ChefClient" | |
}, |
This file contains 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
{ | |
"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", |
This file contains 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": "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": { |
This file contains 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
{ | |
"ChefClientWaitHandle": { | |
"Type": "AWS::CloudFormation::WaitConditionHandle" | |
}, | |
"ChefClientWaitCondition": { | |
"Type": "AWS::CloudFormation::WaitCondition", | |
"DependsOn": "ChefClient", | |
"Properties": { | |
"Handle": { | |
"Ref": "ChefClientWaitHandle" |
This file contains 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
{ | |
"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", |
This file contains 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
{ | |
"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", |
NewerOlder