SlideShare a Scribd company logo
1 of 81
Download to read offline
Masterclass
ianmas@amazon.com
@IanMmmm
Ian Massingham — Technical Evangelist
AWS CloudFormation
Masterclass
Intended to educate you on how to get the best from AWS services
Show you how things work and how to get things done
A technical deep dive that goes beyond the basics
AWS CloudFormation
An easy way to create & manage a collection of AWS resources

Allows orderly and predictable provisioning and updating of resources

Allows you to version control your AWS infrastructure 

Deploy and update stacks using console, command line or API

You only pay for the resources you create
AWS CloudFormation
Don’t reinvent the wheel Declarative & Flexible
Transparent and Open
No Extra Charge
Integration Ready
Customized via Parameters
CloudFormation - Components & Technology
Template CloudFormation Stack
JSON formatted file
Parameter definition
Resource creation
Configuration actions
Configured AWS services
Comprehensive service support
Service event aware
Customisable
Framework
Stack creation
Stack updates
Error detection and rollback
Agenda
Creating Templates

Using a Template to Create and Manage a Stack

Working with the CloudFormation API

Working with AWS Resources

Bootstrapping Applications and Handling Updates
CREATING TEMPLATES
CLOUDFORMATION TEMPLATES
Familiar JSON Format
ReusableManage Relationships
Automate Generation Avoid Collisions
Provide Feedback
Write & GoLook Up Resources
High Level Template Structure
{	
  
	
  	
  	
  	
  "Description"	
  :	
  "A	
  text	
  description	
  for	
  the	
  template	
  usage",	
  
	
  	
  	
  	
  "Parameters":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  A	
  set	
  of	
  inputs	
  used	
  to	
  customize	
  the	
  template	
  per	
  deployment	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "Resources"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  The	
  set	
  of	
  AWS	
  resources	
  and	
  relationships	
  between	
  them	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "Outputs"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  //	
  A	
  set	
  of	
  values	
  to	
  be	
  made	
  visible	
  to	
  the	
  stack	
  creator	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "AWSTemplateFormatVersion"	
  :	
  "2010-­‐09-­‐09”	
  
}	
  
A Simple Template that creates an EC2 Instance
{
	
  	
  	
  	
  "Description":	
  "Create	
  an	
  EC2	
  instance	
  running	
  the	
  latest	
  Amazon	
  Linux	
  AMI.",
	
  	
  	
  	
  "Parameters":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "KeyPair":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  EC2	
  Key	
  Pair	
  to	
  allow	
  SSH	
  access	
  to	
  the	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "String"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Resources":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "Ec2Instance":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Properties":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ImageId":	
  "ami-­‐9d23aeea",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "InstanceType"	
  :	
  "m3.medium",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "KeyName":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "KeyPair"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::Instance"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Outputs":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "InstanceId":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  InstanceId	
  of	
  the	
  newly	
  created	
  EC2	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Value":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "Ec2Instance"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
   "AWSTemplateFormatVersion":	
  "2010-­‐09-­‐09"
}
You will be asked to enter values for these
parameters when you create your stack
A Simple Template that creates an EC2 Instance
{
	
  	
  	
  	
  "Description":	
  "Create	
  an	
  EC2	
  instance	
  running	
  the	
  latest	
  Amazon	
  Linux	
  AMI.",
	
  	
  	
  	
  "Parameters":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "KeyPair":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  EC2	
  Key	
  Pair	
  to	
  allow	
  SSH	
  access	
  to	
  the	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "String"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Resources":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "Ec2Instance":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Properties":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ImageId":	
  "ami-­‐9d23aeea",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "InstanceType"	
  :	
  "m3.medium",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "KeyName":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "KeyPair"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::Instance"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Outputs":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "InstanceId":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  InstanceId	
  of	
  the	
  newly	
  created	
  EC2	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Value":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "Ec2Instance"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
   "AWSTemplateFormatVersion":	
  "2010-­‐09-­‐09"
}
Includes statically defined properties
(ImageID & Instance Type) plus a reference to
the KeyPair parameter. ImageID is the AMI
specific to the region that you will launch this
stack in, in this case the eu-west-1 region
A Simple Template that creates an EC2 Instance
{
	
  	
  	
  	
  "Description":	
  "Create	
  an	
  EC2	
  instance	
  running	
  the	
  latest	
  Amazon	
  Linux	
  AMI.",
	
  	
  	
  	
  "Parameters":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "KeyPair":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  EC2	
  Key	
  Pair	
  to	
  allow	
  SSH	
  access	
  to	
  the	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "String"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Resources":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "Ec2Instance":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Properties":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ImageId":	
  "ami-­‐9d23aeea",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "InstanceType"	
  :	
  "m3.medium",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "KeyName":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "KeyPair"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::Instance"
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
  	
  	
  	
  "Outputs":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  "InstanceId":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  InstanceId	
  of	
  the	
  newly	
  created	
  EC2	
  instance",
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Value":	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Ref":	
  "Ec2Instance"
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  },
	
   "AWSTemplateFormatVersion":	
  "2010-­‐09-­‐09"
}
These outputs will be returned once the
template has completed execution
SOURCE CODE
REPOSITORY
DNS
CONTINUOUS
INTEGRATION SERVER
PROJECT MANAGEMENT
SERVER
BUILDS
CLOUDFORMATION
TEMPLATE
github.com/cloudtools/troposphere

… but remember that a CloudFormation
template is just JSON, so any tool that can
generate output in JSON can be used
CREATING & MANAGING STACKS
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
IncorrectSyntax
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Provides
Feedback
Using a template
to create and
manage a stack
Provides
Feedback
Using a template
to create and
manage a stack
CorrectSyntax
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Replaces
Resources
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Using a template
to create and
manage a stack
Cleans
Up
Resources
Using a template
to create and
manage a stack
aws	
  cloudformation	
  create-­‐stack	
  
	
   -­‐-­‐stack-­‐name	
  ec2InstanceCmdLineDemo	
  
	
   -­‐-­‐template-­‐url	
  https://s3-­‐eu-­‐west-­‐1.amazonaws.com/cf-­‐
templates-­‐1fhelryvrdrbr-­‐eu-­‐west-­‐1/2014174d0r-­‐ec2Instance.template	
  
	
   -­‐-­‐parameters	
  ParameterKey=KeyPair,ParameterValue=ManagementKeyPair	
  
arn:aws:cloudformation:eu-­‐west-­‐1:554625704737:stack/ec2InstanceCmdLineDemo/
42cc6150-­‐fad7-­‐11e3-­‐8f4d-­‐5017e1aef4e7
Using a template to create and manage a stack via the AWS CLI
Returns the details of the created stack, in the output format of your choice
Using a template
to create and
manage a stack
via the AWS CLI
cancel-­‐update-­‐stack	
  	
  	
  	
  	
  	
  	
  	
  get-­‐stack-­‐policy
create-­‐stack	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  get-­‐template
delete-­‐stack	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  list-­‐stack-­‐resources
describe-­‐stack-­‐events	
  	
  	
  	
  	
  	
  list-­‐stacks
describe-­‐stack-­‐resource	
  	
  	
  	
  set-­‐stack-­‐policy
describe-­‐stack-­‐resources	
  	
  	
  update-­‐stack
describe-­‐stacks	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  validate-­‐template
$	
  aws	
  cloudformation	
  update-­‐stack	
  help
Other AWS CLI actions for CloudFormation
As usual, you can get more details via the AWS CLI
$	
  aws	
  cloudformation	
  update-­‐stack	
  help
SYNOPSIS
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  update-­‐stack
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐stack-­‐name	
  <value>
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐template-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐template-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐use-­‐previous-­‐template	
  |	
  -­‐-­‐no-­‐use-­‐previous-­‐template]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐parameters	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐capabilities	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐notification-­‐arns	
  <value>]	
  
Help via the AWS CLI
$	
  aws	
  cloudformation	
  update-­‐stack	
  help
SYNOPSIS
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  update-­‐stack
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐stack-­‐name	
  <value>
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐template-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐template-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐use-­‐previous-­‐template	
  |	
  -­‐-­‐no-­‐use-­‐previous-­‐template]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐parameters	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐capabilities	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐body	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐stack-­‐policy-­‐url	
  <value>]
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  [-­‐-­‐notification-­‐arns	
  <value>]
Builtusing
the
CloudForm
ation
API
CloudFormation API Reference : docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html
WORKING WITH AWS RESOURCES
Designed to use your existing experience with AWS
Each resource has a set of parameters with names
that are identical to the names used to create the
resources through their native API
Template reference: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html
"myVolume"	
  :	
  {	
  
	
  	
  	
  	
  "Type"	
  :	
  "AWS::EC2::Volume",	
  
	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "Size"	
  :	
  "10",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SnapshotId"	
  :	
  "snap-­‐7b8fd361",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AvailabilityZone"	
  :	
  "eu-­‐west-­‐1a"	
  
	
  	
  	
  	
  }	
  
}	
  
This example defines an Amazon EBS Volume with a logical name
‘myVolume’. Its type is "AWS::EC2::Volume”
If you’ve used EBS previously, the properties should look very familiar
"InstanceSecurityGroup"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::EC2::SecurityGroup",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "GroupDescription"	
  :	
  "Enable	
  SSH	
  access	
  via	
  port	
  22",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroupIngress"	
  :	
  [	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "IpProtocol"	
  :	
  "tcp",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "FromPort"	
  :	
  "22",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ToPort"	
  :	
  "22",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "CidrIp"	
  :	
  "0.0.0.0/0"	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  ]	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }	
  
Creating a Security Group resource
• Auto Scaling

• Amazon CloudFront

• AWS CloudWatch

• Amazon DynamoDB

• Amazon EC2

• Amazon ElastiCache

• AWS Elastic Beanstalk

• AWS Elastic Load Balancing

• AWS Identity and Access Management
• Amazon RDS

• Amazon Redshift

• Amazon Route 53

• Amazon S3

• Amazon SimpleDB

• Amazon SNS

• Amazon SQS

• Amazon VPC
Supported AWS Services:
REFERENCING THE PROPERTIES
OF ANOTHER RESOURCE
{	
  "Resources"	
  :	
  {	
  	
  
	
   "Ec2Instance"	
  :	
  {	
  	
  
	
   	
   "Type"	
  :	
  "AWS::EC2::Instance",
	
   	
   	
  "Properties"	
  :	
  {	
  	
  
	
   	
   	
   "SecurityGroups"	
  :	
  [	
  {	
  "Ref"	
  :	
  "InstanceSecurityGroup"	
  }	
  ],	
   	
  
	
  	
   	
   	
   "KeyName"	
  :	
  "mykey",
	
   	
   	
   "ImageId"	
  :	
  "ami-­‐7a11e213”
	
   	
   }
	
   	
  },	
  	
  
	
   "InstanceSecurityGroup"	
  :	
  {	
  	
  
	
   	
   "Type"	
  :	
  "AWS::EC2::SecurityGroup",
	
   	
   	
  "Properties"	
  :	
  {	
  	
  
	
   	
   	
   "GroupDescription"	
  :	
  "Enable	
  SSH	
  access	
  via	
  port	
  22",	
  
	
   	
   	
   "SecurityGroupIngress"	
  :	
  [	
  {	
  	
  
	
   	
   	
   	
   	
   "IpProtocol"	
  :	
  "tcp",	
  	
  
	
   	
   	
   	
   	
   "FromPort"	
  :	
  "22",	
  	
  
	
   	
   	
   	
   	
   "ToPort"	
  :	
  "22",	
  	
  
	
   	
   	
   	
   	
   "CidrIp"	
  :"0.0.0.0/0"	
  }	
  ]	
  
	
   	
   }
	
   	
  }	
  	
  
}	
  }
Reference
Function
{	
  "Resources"	
  :	
  {	
  	
  
	
   "Ec2Instance"	
  :	
  {	
  	
  
	
   	
   "Type"	
  :	
  "AWS::EC2::Instance",
	
   	
   "Properties"	
  :	
  {	
  	
  
	
   	
   "SecurityGroups"	
  :	
  [	
  {	
  "Ref"	
  :	
  "InstanceSecurityGroup"	
  },	
  ,	
  
"MyExistingSG"	
  ],	
   	
   "KeyName"	
  :	
  "mykey",	
  	
  
	
   	
   "ImageId"	
  :	
  "ami-­‐7a11e213"	
  }
	
   	
  },	
  	
  
	
   "InstanceSecurityGroup"	
  :	
  {	
  	
  
	
   	
   "Type"	
  :	
  "AWS::EC2::SecurityGroup",
	
   	
   	
  "Properties"	
  :	
  {	
  	
  
	
   	
   	
   "GroupDescription"	
  :	
  "Enable	
  SSH	
  access	
  via	
  port	
  22",	
  
	
   	
   	
   "SecurityGroupIngress"	
  :	
  [	
  {	
  
	
   	
   	
   	
   "IpProtocol"	
  :	
  "tcp",	
  	
  
	
   	
   	
   	
   "FromPort"	
  :	
  "22",	
  	
  
	
   	
   	
   	
   "ToPort"	
  :	
  "22",	
  	
  
	
   	
   	
   	
   "CidrIp"	
  :"0.0.0.0/0"	
  }	
  ]	
  
	
   	
   }
	
   	
  }	
  	
  
}	
  }
Literal
References
REFERENCING INPUT PARAMETERS
{
"Parameters"	
  :	
  {
	
   "KeyPair"	
  :	
  {	
  	
  
	
   "Description"	
  :	
  "The	
  EC2	
  Key	
  Pair	
  to	
  allow	
  SSH	
  access	
  to	
  the	
  instance",	
  	
  
	
   "Type"	
  :	
  "String"	
  	
  
},
"Resources"	
  :	
  {	
  	
  
	
   	
   "Ec2Instance"	
  :	
  {	
  	
  
	
   	
   "Type"	
  :	
  "AWS::EC2::Instance",
	
   	
   	
  "Properties"	
  :	
  {	
  	
  
	
   	
   	
   "SecurityGroups"	
  :	
  [	
  {	
  "Ref"	
  :	
  "InstanceSecurityGroup"	
  }],	
   	
  
	
   	
   	
   "KeyName"	
  :	
  {	
  "Ref"	
  :	
  "KeyPair"},	
  
	
   	
   	
   "ImageId"	
  :	
  ""	
  }
	
   	
  },	
  
	
   …	
  	
  
}	
  }
Input
Param
eters
Input
Param
eters
"WordPressUser":	
  {
	
   "Default":	
  "admin",	
  
	
   "Description"	
  :	
  "The	
  WordPress	
  database	
  admin	
  account	
  username",
	
  	
   "Type":	
  "String",	
  	
  
	
   "MinLength":	
  "1",	
  	
  
	
   "MaxLength":	
  "16",	
  	
  
	
   "AllowedPattern"	
  :	
  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*"	
  	
  
},
Validate your input parameters with :
Maxlength, MinLength, MaxValue, MinValue, AllowedPattern, AllowedValues
Input
Param
eters
CONDITIONAL VALUES
{"Mappings"	
  :	
  {
	
   	
   	
  "RegionMap"	
  :	
  {	
  	
  
	
   	
   	
   "us-­‐east-­‐1"	
  :	
  {	
  "AMI"	
  :	
  "ami-­‐76f0061f"	
  },
	
   	
   	
   "us-­‐west-­‐1"	
  :	
  {	
  "AMI"	
  :	
  "ami-­‐655a0a20"	
  },	
  	
  
	
   	
   	
   "eu-­‐west-­‐1"	
  :	
  {	
  "AMI"	
  :	
  "ami-­‐7fd4e10b"	
  },	
  	
  
	
   	
   	
   "ap-­‐southeast-­‐1"	
  :	
  {	
  "AMI"	
  :	
  "ami-­‐72621c20"	
  },
	
   	
   	
   "ap-­‐northeast-­‐1"	
  :	
  {	
  "AMI"	
  :	
  "ami-­‐8e08a38f"	
  }	
  }	
  },
	
  "Resources"	
  :	
  {	
  	
  
	
   "Ec2Instance"	
  :	
  {
	
   "Type"	
  :	
  "AWS::EC2::Instance",	
  	
  
	
   "Properties"	
  :	
  {	
  	
  
	
   	
   "KeyName"	
  :	
  {	
  "Ref"	
  :	
  "KeyName"	
  },	
  	
  
	
   	
   “ImageId"	
  :	
  {	
  	
  
	
   	
   	
   "Fn::FindInMap"	
  :	
  [	
  "RegionMap",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "AMI"	
  ]}
	
   	
   	
  }
	
   }	
  
}	
  }
M
appings
Other intrinsic functions and pseudo parameters
Pseudo parameters

AWS::NotificationARNs

AWS::Region

AWS::StackId

AWS::StackName
Intrinsic functions

Fn::Base64

Fn::FindInMap

Fn::GetAtt

Fn::GetAZs

Fn::Join

Fn::Select

Ref
Working with non-AWS Resources
Defining custom resources allows you
to include non-AWS resources in a
CloudFormation stack
More on Custom Resources in ‘AWS CloudFormation under the Hood’ from re:Invent 2013: http://youtu.be/ZhGMaw67Yu0
AWS CloudFormation Custom Resource Walkthrough documentation:
docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-walkthrough.html
BOOTSTRAPPING APPLICATIONS
AND HANDLING UPDATES
"Resources"	
  :	
  {	
  
	
  	
  	
  	
  "Ec2Instance"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::EC2::Instance",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "KeyName"	
  :	
  {	
  "Ref"	
  :	
  "KeyName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroups"	
  :	
  [	
  {	
  "Ref"	
  :	
  "InstanceSecurityGroup"	
  }	
  ],	
  
	
  	
  	
  	
  	
  	
  	
  	
  "ImageId"	
  :	
  {	
  "Fn::FindInMap"	
  :	
  [	
  "RegionMap",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "AMI"	
  ]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  "UserData"	
  :	
  {	
  "Fn::Base64"	
  :	
  {	
  "Fn::Join"	
  :	
  ["",[	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "#!/bin/bash	
  -­‐ex","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum	
  -­‐y	
  install	
  gcc-­‐c++	
  make","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum	
  -­‐y	
  install	
  mysql-­‐devel	
  sqlite-­‐devel","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum	
  -­‐y	
  install	
  ruby-­‐rdoc	
  rubygems	
  ruby-­‐mysql	
  ruby-­‐devel","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "gem	
  install	
  -­‐-­‐no-­‐ri	
  -­‐-­‐no-­‐rdoc	
  rails","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "gem	
  install	
  -­‐-­‐no-­‐ri	
  -­‐-­‐no-­‐rdoc	
  mysql","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "gem	
  install	
  -­‐-­‐no-­‐ri	
  -­‐-­‐no-­‐rdoc	
  sqlite3","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "rails	
  new	
  myapp","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "cd	
  myapp","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "rails	
  server	
  -­‐d","n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "curl	
  -­‐X	
  PUT	
  -­‐H	
  'Content-­‐Type:'	
  -­‐-­‐data-­‐binary	
  '{"Status"	
  :	
  "SUCCESS",",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ""Reason"	
  :	
  "The	
  application	
  myapp	
  is	
  ready",",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ""UniqueId"	
  :	
  "myapp",",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ""Data"	
  :	
  "Done"}'	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  """,	
  {"Ref"	
  :	
  "WaitForInstanceWaitHandle"},""n"	
  ]]}}	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }
Option 1: Continue to use EC2 UserData, which is available as
a property of AWS::EC2::Instance resources
cfn-hup
cfn-signal
cfn-get-metadata
Amazon EC2AWS CloudFormation
cfn-init
Metadata Key — AWS::CloudFormation::Init	
  
Cfn-init reads this metadata key and installs the packages listed in this key (e.g.,
httpd, mysql, and php). Cfn-init also retrieves and expands files listed as sources.
Option 2: AWS CloudFormation provides helper scripts for
deployment within your EC2 instances
"Resources"	
  :	
  {	
  
	
  	
  	
  	
  "WebServer":	
  {	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::Instance",	
  
	
  	
  	
  	
  	
  	
  "Metadata"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "Comment1"	
  :	
  "Configure	
  the	
  bootstrap	
  helpers	
  to	
  install	
  the	
  Apache	
  Web	
  Server	
  and	
  PHP",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "Comment2"	
  :	
  "The	
  website	
  content	
  is	
  downloaded	
  from	
  the	
  CloudFormationPHPSample.zip	
  file",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AWS::CloudFormation::Init"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "config"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "packages"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mysql"	
  	
  	
  	
  	
  	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mysql-­‐server"	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mysql-­‐libs"	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "httpd"	
  	
  	
  	
  	
  	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "php"	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "php-­‐mysql"	
  	
  	
  	
  :	
  []	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sources"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/var/www/html"	
  :	
  "https://s3.amazonaws.com/cloudformation-­‐examples/CloudFormationPHPSample.zip"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  }
Installing
Packages
&
Expanding
Files
 "Properties":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "ImageId"	
  :	
  {	
  "Fn::FindInMap"	
  :	
  [	
  "AWSRegionArch2AMI",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  "Fn::FindInMap"	
  :	
  [	
  "AWSInstanceType2Arch",	
  {	
  "Ref"	
  :	
  "InstanceType"	
  },	
  "Arch"	
  ]	
  }	
  ]	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "InstanceType"	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "InstanceType"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroups"	
  :	
  [	
  {"Ref"	
  :	
  "WebServerSecurityGroup"}	
  ],	
  
	
  	
  	
  	
  	
  	
  	
  	
  "KeyName"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "KeyName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "UserData"	
  	
  	
  	
  	
  	
  	
  :	
  {	
  "Fn::Base64"	
  :	
  {	
  "Fn::Join"	
  :	
  ["",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "#!/bin/bash	
  -­‐vn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum	
  update	
  -­‐y	
  aws-­‐cfn-­‐bootstrapn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "#	
  Install	
  packagesn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/opt/aws/bin/cfn-­‐init	
  -­‐s	
  ",	
  {	
  "Ref"	
  :	
  "AWS::StackName"	
  },	
  "	
  -­‐r	
  WebServer	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  -­‐-­‐region	
  ",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "	
  ||	
  error_exit	
  'Failed	
  to	
  run	
  cfn-­‐init'n"	
  
	
   	
   	
  	
  ]]}}	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },
The UserData key allows you to execute shell commands.
This template issues two shell commands: the first command installs the AWS
CloudFormation helper scripts; the second executes the cfn-init script.
Installing
&
executing
CloudForm
ation
helper
 "files"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/tmp/setup.mysql"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "content"	
  :	
  {	
  "Fn::Join"	
  :	
  ["",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "CREATE	
  DATABASE	
  ",	
  {	
  "Ref"	
  :	
  "DBName"	
  },	
  ";n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "GRANT	
  ALL	
  ON	
  ",	
  {	
  "Ref"	
  :	
  "DBName"	
  },	
  ".*	
  TO	
  '",	
  {	
  "Ref"	
  :	
  "DBUsername"	
  },	
  "'@localhost	
  IDENTIFIED	
  BY	
  
'",	
  {	
  "Ref"	
  :	
  "DBPassword"	
  },	
  "';n"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mode"	
  	
  :	
  "000644",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "owner"	
  :	
  "root",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "group"	
  :	
  "root"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
The files key allows you to write files to the instance filesystem
Creating
files
on
Instance
Filesystem
s
"services"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sysvinit"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mysqld"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "enabled"	
  	
  	
  	
  	
  	
  	
  :	
  "true",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ensureRunning"	
  :	
  "true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "httpd"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "enabled"	
  	
  	
  	
  	
  	
  	
  :	
  "true",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ensureRunning"	
  :	
  "true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }
The services key allows you ensures that the services are not only running
when cfn-init finishes (ensureRunning is set to true); but that they are also
restarted upon reboot (enabled is set to true).
Controlling
Services
More on Deploying Applications with AWS CloudFormation:
docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applications.html
Yes!
All this functionality is available for
Windows instances too!
Bootstrapping AWS CloudFormation Windows Stacks:
docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-windows-stacks-bootstrapping.html
Find out more here: aws.amazon.com/cloudformation/aws-cloudformation-articles-and-tutorials/
What about Chef?
	 and/or
What about Puppet?
SUMMARY
An easy way to create & manage a collection of AWS resources1
Allows orderly and predictable provisioning and updating of resources2
Allows you to version control your AWS infrastructure3
Deploy and update stacks using console, command line or API4
RESOURCES YOU CAN USE
TO LEARN MORE
aws.amazon.com/cloudformation/
Getting Started with AWS CloudFormation:
aws.amazon.com/cloudformation/getting-started/

AWS CloudFormation Templates & Samples:
aws.amazon.com/cloudformation/aws-cloudformation-templates/

AWS cfncluster HPC deployment framework:
github.com/awslabs/cfncluster/
{	
  
	
  	
  "AWSTemplateFormatVersion"	
  :	
  "2010-­‐09-­‐09",	
  
	
  	
  "Description"	
  :	
  "AWS	
  CloudFormation	
  Sample	
  Template	
  WordPress_Multi_AZ:	
  WordPress	
  is	
  web	
  software	
  you	
  can	
  use	
  to	
  create	
  a	
  beautiful	
  website	
  or	
  blog.	
  This	
  template	
  
installs	
  a	
  highly-­‐available,	
  scalable	
  WordPress	
  deployment	
  using	
  a	
  multi-­‐az	
  Amazon	
  RDS	
  database	
  instance	
  for	
  storage.	
  It	
  demonstrates	
  using	
  the	
  AWS	
  CloudFormation	
  bootstrap	
  
scripts	
  to	
  deploy	
  WordPress.	
  **WARNING**	
  This	
  template	
  creates	
  an	
  Amazon	
  EC2	
  instance,	
  an	
  Elastic	
  Load	
  Balancer	
  and	
  an	
  Amazon	
  RDS	
  database	
  instance.	
  You	
  will	
  be	
  billed	
  for	
  
the	
  AWS	
  resources	
  used	
  if	
  you	
  create	
  a	
  stack	
  from	
  this	
  template.",	
  
	
  	
  "Parameters"	
  :	
  {	
  
	
  	
  	
  	
  "KeyName":	
  {	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "Name	
  of	
  an	
  existing	
  EC2	
  KeyPair	
  to	
  enable	
  SSH	
  access	
  to	
  the	
  instances",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::KeyPair::KeyName",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  be	
  the	
  name	
  of	
  an	
  existing	
  EC2	
  KeyPair."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "InstanceType"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "WebServer	
  EC2	
  instance	
  type",	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "String",	
  
	
  	
  	
  	
  	
  	
  "Default"	
  :	
  "m1.small",	
  
	
  	
  	
  	
  	
  	
  "AllowedValues"	
  :	
  [	
  "t1.micro",	
  "t2.micro",	
  "t2.small",	
  "t2.medium",	
  "m1.small",	
  "m1.medium",	
  "m1.large",	
  "m1.xlarge",	
  "m2.xlarge",	
  "m2.2xlarge",	
  "m2.4xlarge",	
  
"m3.medium",	
  "m3.large",	
  "m3.xlarge",	
  "m3.2xlarge",	
  "c1.medium",	
  "c1.xlarge",	
  "c3.large",	
  "c3.xlarge",	
  "c3.2xlarge",	
  "c3.4xlarge",	
  "c3.8xlarge",	
  "c4.large",	
  "c4.xlarge",	
  
"c4.2xlarge",	
  "c4.4xlarge",	
  "c4.8xlarge",	
  "g2.2xlarge",	
  "r3.large",	
  "r3.xlarge",	
  "r3.2xlarge",	
  "r3.4xlarge",	
  "r3.8xlarge",	
  "i2.xlarge",	
  "i2.2xlarge",	
  "i2.4xlarge",	
  
"i2.8xlarge",	
  "hi1.4xlarge",	
  "hs1.8xlarge",	
  "cr1.8xlarge",	
  "cc2.8xlarge",	
  "cg1.4xlarge"]	
  
,	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  be	
  a	
  valid	
  EC2	
  instance	
  type."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "SSHLocation":	
  {	
  
	
  	
  	
  	
  	
  	
  "Description":	
  "The	
  IP	
  address	
  range	
  that	
  can	
  be	
  used	
  to	
  SSH	
  to	
  the	
  EC2	
  instances",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "String",	
  
	
  	
  	
  	
  	
  	
  "MinLength":	
  "9",	
  
	
  	
  	
  	
  	
  	
  "MaxLength":	
  "18",	
  
	
  	
  	
  	
  	
  	
  "Default":	
  "0.0.0.0/0",	
  
	
  	
  	
  	
  	
  	
  "AllowedPattern":	
  "(d{1,3}).(d{1,3}).(d{1,3}).(d{1,3})/(d{1,2})",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription":	
  "must	
  be	
  a	
  valid	
  IP	
  CIDR	
  range	
  of	
  the	
  form	
  x.x.x.x/x."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBClass"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "Database	
  instance	
  class",	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "String",	
  
	
  	
  	
  	
  	
  	
  "Default"	
  :	
  "db.m1.small",	
  
	
  	
  	
  	
  	
  	
  "AllowedValues"	
  :	
  [	
  "db.t1.micro",	
  "db.m1.small",	
  "db.m1.medium",	
  "db.m1.large",	
  "db.m1.xlarge",	
  "db.m2.xlarge",	
  "db.m2.2xlarge",	
  "db.m2.4xlarge",	
  "db.m3.medium",	
  
"db.m3.large",	
  "db.m3.xlarge",	
  "db.m3.2xlarge",	
  "db.r3.large",	
  "db.r3.xlarge",	
  "db.r3.2xlarge",	
  "db.r3.4xlarge",	
  "db.r3.8xlarge",	
  "db.m2.xlarge",	
  "db.m2.2xlarge",	
  
"db.m2.4xlarge",	
  "db.cr1.8xlarge"]	
  
,	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  select	
  a	
  valid	
  database	
  instance	
  type."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBName"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Default":	
  "wordpressdb",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "The	
  WordPress	
  database	
  name",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "String",	
  
	
  	
  	
  	
  	
  	
  "MinLength":	
  "1",	
  
	
  	
  	
  	
  	
  	
  "MaxLength":	
  "64",	
  
	
  	
  	
  	
  	
  	
  "AllowedPattern"	
  :	
  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  begin	
  with	
  a	
  letter	
  and	
  contain	
  only	
  alphanumeric	
  characters."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBUser"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "NoEcho":	
  "true",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "The	
  WordPress	
  database	
  admin	
  account	
  username",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "String",	
  
	
  	
  	
  	
  	
  	
  "MinLength":	
  "1",	
  
	
  	
  	
  	
  	
  	
  "MaxLength":	
  "16",	
  
	
  	
  	
  	
  	
  	
  "AllowedPattern"	
  :	
  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  begin	
  with	
  a	
  letter	
  and	
  contain	
  only	
  alphanumeric	
  characters."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBPassword"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "NoEcho":	
  "true",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "The	
  WordPress	
  database	
  admin	
  account	
  password",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "String",	
  
	
  	
  	
  	
  	
  	
  "MinLength":	
  "8",	
  
	
  	
  	
  	
  	
  	
  "MaxLength":	
  "41",	
  
	
  	
  	
  	
  	
  	
  "AllowedPattern"	
  :	
  "[a-­‐zA-­‐Z0-­‐9]*",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  contain	
  only	
  alphanumeric	
  characters."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "MultiAZDatabase":	
  {	
  
	
  	
  	
  	
  	
  	
  "Default":	
  "false",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "Create	
  a	
  Multi-­‐AZ	
  MySQL	
  Amazon	
  RDS	
  database	
  instance",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "String",	
  
	
  	
  	
  	
  	
  	
  "AllowedValues"	
  :	
  [	
  "true",	
  "false"	
  ],	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  be	
  either	
  true	
  or	
  false."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "WebServerCapacity":	
  {	
  
	
  	
  	
  	
  	
  	
  "Default":	
  "1",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "The	
  initial	
  number	
  of	
  WebServer	
  instances",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "Number",	
  
	
  	
  	
  	
  	
  	
  "MinValue":	
  "1",	
  
	
  	
  	
  	
  	
  	
  "MaxValue":	
  "5",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  be	
  between	
  1	
  and	
  5	
  EC2	
  instances."	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBAllocatedStorage"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Default":	
  "5",	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "The	
  size	
  of	
  the	
  database	
  (Gb)",	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "Number",	
  
	
  	
  	
  	
  	
  	
  "MinValue":	
  "5",	
  
	
  	
  	
  	
  	
  	
  "MaxValue":	
  "1024",	
  
	
  	
  	
  	
  	
  	
  "ConstraintDescription"	
  :	
  "must	
  be	
  between	
  5	
  and	
  1024Gb."	
  
	
  	
  	
  	
  }	
  
	
  	
  },	
  
	
  	
  "Mappings"	
  :	
  {	
  
	
  	
  	
  	
  "AWSInstanceType2Arch"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "t1.micro"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "t2.micro"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "t2.small"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "t2.medium"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m1.small"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m1.medium"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m1.large"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m1.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m2.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m2.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m2.4xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m3.medium"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m3.large"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m3.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "m3.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c1.medium"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c1.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "PV64"	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c3.large"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c3.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c3.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c3.4xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c3.8xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c4.large"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c4.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c4.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c4.4xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "c4.8xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "g2.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVMG2"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "r3.large"	
  	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "r3.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "r3.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "r3.4xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "r3.8xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "i2.xlarge"	
  	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "i2.2xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "i2.4xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "i2.8xlarge"	
  	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "hi1.4xlarge"	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "hs1.8xlarge"	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "cr1.8xlarge"	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "cc2.8xlarge"	
  :	
  {	
  "Arch"	
  :	
  "HVM64"	
  	
  }	
  
	
  	
  	
  	
  }	
  
,	
  
	
  	
  	
  	
  "AWSRegionArch2AMI"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "us-­‐east-­‐1"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐8e682ce6",	
  "HVM64"	
  :	
  "ami-­‐146e2a7c",	
  "HVMG2"	
  :	
  "ami-­‐7200461a"},	
  
	
  	
  	
  	
  	
  	
  "us-­‐west-­‐2"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐9fc29baf",	
  "HVM64"	
  :	
  "ami-­‐dfc39aef",	
  "HVMG2"	
  :	
  "ami-­‐0b78203b"},	
  
	
  	
  	
  	
  	
  	
  "us-­‐west-­‐1"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐f49089b1",	
  "HVM64"	
  :	
  "ami-­‐42908907",	
  "HVMG2"	
  :	
  "ami-­‐244b5361"},	
  
	
  	
  	
  	
  	
  	
  "eu-­‐west-­‐1"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐7b3db00c",	
  "HVM64"	
  :	
  "ami-­‐9d23aeea",	
  "HVMG2"	
  :	
  "ami-­‐4d7cf03a"},	
  
	
  	
  	
  	
  	
  	
  "eu-­‐central-­‐1"	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐0600331b",	
  "HVM64"	
  :	
  "ami-­‐04003319",	
  "HVMG2"	
  :	
  "NOT_SUPPORTED"},	
  
	
  	
  	
  	
  	
  	
  "ap-­‐northeast-­‐1"	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐3c87993d",	
  "HVM64"	
  :	
  "ami-­‐18869819",	
  "HVMG2"	
  :	
  "ami-­‐2e90892f"},	
  
	
  	
  	
  	
  	
  	
  "ap-­‐southeast-­‐1"	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐58ba910a",	
  "HVM64"	
  :	
  "ami-­‐96bb90c4",	
  "HVMG2"	
  :	
  "ami-­‐3e78526c"},	
  
	
  	
  	
  	
  	
  	
  "ap-­‐southeast-­‐2"	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐1500742f",	
  "HVM64"	
  :	
  "ami-­‐d50773ef",	
  "HVMG2"	
  :	
  "ami-­‐315e2a0b"},	
  
	
  	
  	
  	
  	
  	
  "sa-­‐east-­‐1"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐fd9925e0",	
  "HVM64"	
  :	
  "ami-­‐af9925b2",	
  "HVMG2"	
  :	
  "NOT_SUPPORTED"},	
  
	
  	
  	
  	
  	
  	
  "cn-­‐north-­‐1"	
  	
  	
  	
  	
  	
  	
  :	
  {"PV64"	
  :	
  "ami-­‐8a1d8fb3",	
  "HVM64"	
  :	
  "ami-­‐981d8fa1",	
  "HVMG2"	
  :	
  "NOT_SUPPORTED"}	
  
	
  	
  	
  	
  }	
  
	
  	
  },	
  
	
  	
  "Conditions"	
  :	
  {	
  
	
  	
  	
  	
  "Is-­‐EC2-­‐VPC"	
  	
  	
  	
  	
  :	
  {	
  "Fn::Or"	
  :	
  [	
  {"Fn::Equals"	
  :	
  [{"Ref"	
  :	
  "AWS::Region"},	
  "eu-­‐central-­‐1"	
  ]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"Fn::Equals"	
  :	
  [{"Ref"	
  :	
  "AWS::Region"},	
  "cn-­‐north-­‐1"	
  ]}]},	
  
	
  	
  	
  	
  "Is-­‐EC2-­‐Classic"	
  :	
  {	
  "Fn::Not"	
  :	
  [{	
  "Condition"	
  :	
  "Is-­‐EC2-­‐VPC"}]}	
  
	
  	
  },	
  
	
  	
  "Resources"	
  :	
  {	
  
	
  	
  	
  	
  "ElasticLoadBalancer"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::ElasticLoadBalancing::LoadBalancer",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AvailabilityZones"	
  :	
  {	
  "Fn::GetAZs"	
  :	
  ""	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "CrossZone"	
  :	
  "true",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "LBCookieStickinessPolicy"	
  :	
  [	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "PolicyName"	
  :	
  "CookieBasedPolicy",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "CookieExpirationPeriod"	
  :	
  "30"	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  ],	
  
	
  	
  	
  	
  	
  	
  	
  	
  "Listeners"	
  :	
  [	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "LoadBalancerPort"	
  :	
  "80",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "InstancePort"	
  :	
  "80",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Protocol"	
  :	
  "HTTP",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "PolicyNames"	
  :	
  [	
  "CookieBasedPolicy"	
  ]	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  ],	
  
	
  	
  	
  	
  	
  	
  	
  	
  "HealthCheck"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Target"	
  :	
  "HTTP:80/wordpress/wp-­‐admin/install.php",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "HealthyThreshold"	
  :	
  "2",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "UnhealthyThreshold"	
  :	
  "5",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Interval"	
  :	
  "10",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Timeout"	
  :	
  "5"	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "WebServerSecurityGroup"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::EC2::SecurityGroup",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "GroupDescription"	
  :	
  "Enable	
  HTTP	
  access	
  via	
  port	
  80	
  locked	
  down	
  to	
  the	
  load	
  balancer	
  +	
  SSH	
  access",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroupIngress"	
  :	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"IpProtocol"	
  :	
  "tcp",	
  "FromPort"	
  :	
  "80",	
  "ToPort"	
  :	
  "80",	
  "SourceSecurityGroupOwnerId"	
  :	
  {"Fn::GetAtt"	
  :	
  ["ElasticLoadBalancer",	
  
"SourceSecurityGroup.OwnerAlias"]},"SourceSecurityGroupName"	
  :	
  {"Fn::GetAtt"	
  :	
  ["ElasticLoadBalancer",	
  "SourceSecurityGroup.GroupName"]}},	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"IpProtocol"	
  :	
  "tcp",	
  "FromPort"	
  :	
  "22",	
  "ToPort"	
  :	
  "22",	
  "CidrIp"	
  :	
  {	
  "Ref"	
  :	
  "SSHLocation"}}	
  
	
  	
  	
  	
  	
  	
  	
  	
  ]	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "WebServerGroup"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::AutoScaling::AutoScalingGroup",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AvailabilityZones"	
  :	
  {	
  "Fn::GetAZs"	
  :	
  ""	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "LaunchConfigurationName"	
  :	
  {	
  "Ref"	
  :	
  "LaunchConfig"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "MinSize"	
  :	
  "1",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "MaxSize"	
  :	
  "5",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "DesiredCapacity"	
  :	
  {	
  "Ref"	
  :	
  "WebServerCapacity"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "LoadBalancerNames"	
  :	
  [	
  {	
  "Ref"	
  :	
  "ElasticLoadBalancer"	
  }	
  ]	
  
	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "CreationPolicy"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "ResourceSignal"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "Timeout"	
  :	
  "PT15M"	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "UpdatePolicy":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AutoScalingRollingUpdate":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "MinInstancesInService":	
  "1",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "MaxBatchSize":	
  "1",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "PauseTime"	
  :	
  "PT15M",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "WaitOnResourceSignals":	
  "true"	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "LaunchConfig":	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::AutoScaling::LaunchConfiguration",	
  
	
  	
  	
  	
  	
  	
  "Metadata"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AWS::CloudFormation::Init"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "configSets"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "wordpress_install"	
  :	
  ["install_cfn",	
  "install_wordpress"	
  ]	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "install_cfn"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "files":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/etc/cfn/cfn-­‐hup.conf":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "content":	
  {	
  "Fn::Join":	
  [	
  "",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "[main]n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "stack=",	
  {	
  "Ref":	
  "AWS::StackId"	
  },	
  "n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "region=",	
  {	
  "Ref":	
  "AWS::Region"	
  },	
  "n"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mode"	
  	
  :	
  "000400",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "owner"	
  :	
  "root",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "group"	
  :	
  "root"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/etc/cfn/hooks.d/cfn-­‐auto-­‐reloader.conf":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "content":	
  {	
  "Fn::Join":	
  [	
  "",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "[cfn-­‐auto-­‐reloader-­‐hook]n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "triggers=post.updaten",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "path=Resources.LaunchConfig.Metadata.AWS::CloudFormation::Initn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "action=/opt/aws/bin/cfn-­‐init	
  -­‐v	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐stack	
  ",	
  {	
  "Ref"	
  :	
  "AWS::StackName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐resource	
  LaunchConfig	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐configsets	
  wordpress_install	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐region	
  ",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "n"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]]},	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mode"	
  	
  :	
  "000400",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "owner"	
  :	
  "root",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "group"	
  :	
  "root"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "services"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sysvinit"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "cfn-­‐hup"	
  :	
  {	
  "enabled"	
  :	
  "true",	
  "ensureRunning"	
  :	
  "true",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "files"	
  :	
  ["/etc/cfn/cfn-­‐hup.conf",	
  "/etc/cfn/hooks.d/cfn-­‐auto-­‐reloader.conf"]}	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "install_wordpress"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "packages"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "php"	
  	
  	
  	
  	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "php-­‐mysql"	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mysql"	
  	
  	
  	
  	
  :	
  [],	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "httpd"	
  	
  	
  	
  	
  :	
  []	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sources"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/var/www/html"	
  :	
  "http://wordpress.org/latest.tar.gz"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "files"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/tmp/create-­‐wp-­‐config"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "content"	
  :	
  {	
  "Fn::Join"	
  :	
  [	
  "",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "#!/bin/bashn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "cp	
  /var/www/html/wordpress/wp-­‐config-­‐sample.php	
  /var/www/html/wordpress/wp-­‐config.phpn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sed	
  -­‐i	
  "s/'database_name_here'/'",{	
  "Ref"	
  :	
  "DBName"	
  },	
  "'/g"	
  wp-­‐config.phpn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sed	
  -­‐i	
  "s/'username_here'/'",{	
  "Ref"	
  :	
  "DBUser"	
  },	
  "'/g"	
  wp-­‐config.phpn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sed	
  -­‐i	
  "s/'password_here'/'",{	
  "Ref"	
  :	
  "DBPassword"	
  },	
  "'/g"	
  wp-­‐config.phpn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sed	
  -­‐i	
  "s/'localhost'/'",{	
  "Fn::GetAtt"	
  :	
  [	
  "DBInstance",	
  "Endpoint.Address"	
  ]	
  },	
  "'/g"	
  wp-­‐config.phpn"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ]]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "mode"	
  :	
  "000500",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "owner"	
  :	
  "root",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "group"	
  :	
  "root"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "commands"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "01_configure_wordpress"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "command"	
  :	
  "/tmp/create-­‐wp-­‐config",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "cwd"	
  :	
  "/var/www/html/wordpress"	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "services"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sysvinit"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "httpd"	
  :	
  {	
  "enabled"	
  :	
  "true",	
  "ensureRunning"	
  :	
  "true"	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "Properties":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "ImageId"	
  :	
  {	
  "Fn::FindInMap"	
  :	
  [	
  "AWSRegionArch2AMI",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  "Fn::FindInMap"	
  :	
  [	
  "AWSInstanceType2Arch",	
  {	
  "Ref"	
  :	
  "InstanceType"	
  },	
  "Arch"	
  ]	
  }	
  ]	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "InstanceType"	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "InstanceType"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroups"	
  :	
  [	
  {"Ref"	
  :	
  "WebServerSecurityGroup"}	
  ],	
  
	
  	
  	
  	
  	
  	
  	
  	
  "KeyName"	
  	
  	
  	
  	
  	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "KeyName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "UserData"	
  :	
  {	
  "Fn::Base64"	
  :	
  {	
  "Fn::Join"	
  :	
  ["",	
  [	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "#!/bin/bash	
  -­‐xen",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "yum	
  update	
  -­‐y	
  aws-­‐cfn-­‐bootstrapn",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/opt/aws/bin/cfn-­‐init	
  -­‐v	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐stack	
  ",	
  {	
  "Ref"	
  :	
  "AWS::StackName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐resource	
  LaunchConfig	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐configsets	
  wordpress_install	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐region	
  ",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "n",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "/opt/aws/bin/cfn-­‐signal	
  -­‐e	
  $?	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐stack	
  ",	
  {	
  "Ref"	
  :	
  "AWS::StackName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐resource	
  WebServerGroup	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐-­‐region	
  ",	
  {	
  "Ref"	
  :	
  "AWS::Region"	
  },	
  "n"	
  
	
  	
  	
  	
  	
  	
  	
  	
  ]]}}	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBSecurityGroup":	
  {	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::RDS::DBSecurityGroup",	
  
	
  	
  	
  	
  	
  	
  "Condition"	
  :	
  "Is-­‐EC2-­‐Classic",	
  
	
  	
  	
  	
  	
  	
  "Properties":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "DBSecurityGroupIngress":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "EC2SecurityGroupName":	
  {	
  "Ref":	
  "WebServerSecurityGroup"	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "GroupDescription":	
  "database	
  access"	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBEC2SecurityGroup":	
  {	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::EC2::SecurityGroup",	
  
	
  	
  	
  	
  	
  	
  "Condition"	
  :	
  "Is-­‐EC2-­‐VPC",	
  
	
  	
  	
  	
  	
  	
  "Properties"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "GroupDescription":	
  "Open	
  database	
  for	
  access",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "SecurityGroupIngress"	
  :	
  [{	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "IpProtocol"	
  :	
  "tcp",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "FromPort"	
  :	
  "3306",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "ToPort"	
  :	
  "3306",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "SourceSecurityGroupName"	
  :	
  {	
  "Ref"	
  :	
  "WebServerSecurityGroup"	
  }	
  
	
  	
  	
  	
  	
  	
  	
  	
  }]	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  },	
  
	
  	
  	
  	
  "DBInstance"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type":	
  "AWS::RDS::DBInstance",	
  
	
  	
  	
  	
  	
  	
  "Properties":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "DBName"	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "DBName"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "Engine"	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :	
  "MySQL",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "MultiAZ"	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  :	
  {	
  "Ref":	
  "MultiAZDatabase"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "MasterUsername"	
  	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "DBUser"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "MasterUserPassword":	
  {	
  "Ref"	
  :	
  "DBPassword"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "DBInstanceClass"	
  	
  	
  :	
  {	
  "Ref"	
  :	
  "DBClass"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AllocatedStorage"	
  	
  :	
  {	
  "Ref"	
  :	
  "DBAllocatedStorage"	
  },	
  
	
  	
  	
  	
  	
  	
  	
  	
  "VPCSecurityGroups":	
  {	
  "Fn::If"	
  :	
  [	
  "Is-­‐EC2-­‐VPC",	
  [	
  {	
  "Fn::GetAtt":	
  [	
  "DBEC2SecurityGroup",	
  "GroupId"	
  ]	
  }	
  ],	
  {	
  "Ref"	
  :	
  "AWS::NoValue"}]},	
  
	
  	
  	
  	
  	
  	
  	
  	
  "DBSecurityGroups":	
  {	
  "Fn::If"	
  :	
  [	
  "Is-­‐EC2-­‐Classic",	
  [	
  {	
  "Ref":	
  "DBSecurityGroup"	
  }	
  ],	
  {	
  "Ref"	
  :	
  "AWS::NoValue"}]}	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }	
  
	
  	
  },	
  
	
  	
  "Outputs"	
  :	
  {	
  
	
  	
  	
  	
  "WebsiteURL"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Value"	
  :	
  {	
  "Fn::Join"	
  :	
  ["",	
  ["http://",	
  {	
  "Fn::GetAtt"	
  :	
  [	
  "ElasticLoadBalancer",	
  "DNSName"	
  ]},	
  "/wordpress"	
  ]]},	
  
	
  	
  	
  	
  	
  	
  "Description"	
  :	
  "WordPress	
  Website"	
  
	
  	
  	
  	
  }	
  
	
  	
  }	
  
}
CloudFormation Template to Deploy Wordpress
https://s3-us-west-1.amazonaws.com/cloudformation-templates-us-west-1/WordPress_Multi_AZ.template
Certification
aws.amazon.com/certification
Self-Paced Labs
aws.amazon.com/training/

self-paced-labs
Try products, gain new skills, and
get hands-on practice working
with AWS technologies
aws.amazon.com/training
Training
Validate your proven skills and
expertise with the AWS platform
Build technical expertise to
design and operate scalable,
efficient applications on AWS
AWS Training & Certification
LONDON
15 APRIL 2015
aws.amazon.com/summits/london/
AWS CloudFormation will be featured in the Deep Dive: Infrastructure-as-Code breakout session
Follow
us
for m
ore
events
&
w
ebinars
@AWScloud for Global AWS News & Announcements
@AWS_UKI for local AWS events & news
@IanMmmm
Ian Massingham — Technical Evangelist

More Related Content

What's hot

RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012Amazon Web Services
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012Amazon Web Services
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings Adam Book
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAmazon Web Services
 
An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel AvivAn introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel AvivAmazon Web Services
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationAmazon Web Services LATAM
 
The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)Julien SIMON
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAmazon Web Services
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDanilo Poccia
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-upAlex Heneveld
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heatAlex Heneveld
 
DevOps for the Enterprise: Automated Testing and Monitoring
DevOps for the Enterprise: Automated Testing and Monitoring DevOps for the Enterprise: Automated Testing and Monitoring
DevOps for the Enterprise: Automated Testing and Monitoring Amazon Web Services
 
Infrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web ServicesInfrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web ServicesJulien SIMON
 
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015Chef
 
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)Amazon Web Services
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeAmazon Web Services
 
Aws meetup ssm
Aws meetup ssmAws meetup ssm
Aws meetup ssmAdam Book
 
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Amazon Web Services
 

What's hot (20)

RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
 
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel AvivAn introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormation
 
The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)The AWS DevOps combo (January 2017)
The AWS DevOps combo (January 2017)
 
Cloud Formation
Cloud FormationCloud Formation
Cloud Formation
 
AWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as CodeAWS May Webinar Series - Deep Dive: Infrastructure as Code
AWS May Webinar Series - Deep Dive: Infrastructure as Code
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
 
DevOps for the Enterprise: Automated Testing and Monitoring
DevOps for the Enterprise: Automated Testing and Monitoring DevOps for the Enterprise: Automated Testing and Monitoring
DevOps for the Enterprise: Automated Testing and Monitoring
 
Infrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web ServicesInfrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web Services
 
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
 
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Aws meetup ssm
Aws meetup ssmAws meetup ssm
Aws meetup ssm
 
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
Becoming a Command Line Expert with the AWS CLI (TLS304) | AWS re:Invent 2013
 

Viewers also liked

Data Analysis - Journey Through the Cloud
Data Analysis - Journey Through the CloudData Analysis - Journey Through the Cloud
Data Analysis - Journey Through the CloudIan Massingham
 
EC2 Masterclass from the AWS User Group Scotland Meetup
EC2 Masterclass from the AWS User Group Scotland MeetupEC2 Masterclass from the AWS User Group Scotland Meetup
EC2 Masterclass from the AWS User Group Scotland MeetupIan Massingham
 
Scalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudScalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudIan Massingham
 
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014Opportunities that the Cloud Brings for Carriers @ Carriers World 2014
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014Ian Massingham
 
Social & Mobile Apps journey through the cloud
Social & Mobile Apps   journey through the cloudSocial & Mobile Apps   journey through the cloud
Social & Mobile Apps journey through the cloudIan Massingham
 
Partner Event Slides - 24 April 2014
Partner Event Slides - 24 April 2014Partner Event Slides - 24 April 2014
Partner Event Slides - 24 April 2014Ian Massingham
 
Scalable Web Applications Session at Codebase
Scalable Web Applications Session at CodebaseScalable Web Applications Session at Codebase
Scalable Web Applications Session at CodebaseIan Massingham
 
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...Amazon Web Services
 
AWS re:Invent Recap from AWS User Group UK meetup #8
AWS re:Invent Recap from AWS User Group UK meetup #8AWS re:Invent Recap from AWS User Group UK meetup #8
AWS re:Invent Recap from AWS User Group UK meetup #8Ian Massingham
 
AWS DevOps Event - Innovating with DevOps on AWS
AWS DevOps Event - Innovating with DevOps on AWSAWS DevOps Event - Innovating with DevOps on AWS
AWS DevOps Event - Innovating with DevOps on AWSIan Massingham
 
Security Best Practices
Security Best PracticesSecurity Best Practices
Security Best PracticesIan Massingham
 
Advanced Security Masterclass - Tel Aviv Loft
Advanced Security Masterclass - Tel Aviv LoftAdvanced Security Masterclass - Tel Aviv Loft
Advanced Security Masterclass - Tel Aviv LoftIan Massingham
 
Getting started with AWS Lambda and the Serverless Cloud
Getting started with AWS Lambda and the Serverless CloudGetting started with AWS Lambda and the Serverless Cloud
Getting started with AWS Lambda and the Serverless CloudIan Massingham
 
Cost Optimisation with AWS
Cost Optimisation with AWSCost Optimisation with AWS
Cost Optimisation with AWSIan Massingham
 
AWS 101: Introduction to AWS
AWS 101: Introduction to AWSAWS 101: Introduction to AWS
AWS 101: Introduction to AWSIan Massingham
 

Viewers also liked (17)

Data Analysis - Journey Through the Cloud
Data Analysis - Journey Through the CloudData Analysis - Journey Through the Cloud
Data Analysis - Journey Through the Cloud
 
EC2 Masterclass from the AWS User Group Scotland Meetup
EC2 Masterclass from the AWS User Group Scotland MeetupEC2 Masterclass from the AWS User Group Scotland Meetup
EC2 Masterclass from the AWS User Group Scotland Meetup
 
Scalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the CloudScalable Web Apps - Journey Through the Cloud
Scalable Web Apps - Journey Through the Cloud
 
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014Opportunities that the Cloud Brings for Carriers @ Carriers World 2014
Opportunities that the Cloud Brings for Carriers @ Carriers World 2014
 
Social & Mobile Apps journey through the cloud
Social & Mobile Apps   journey through the cloudSocial & Mobile Apps   journey through the cloud
Social & Mobile Apps journey through the cloud
 
Digipack creation
Digipack creationDigipack creation
Digipack creation
 
Partner Event Slides - 24 April 2014
Partner Event Slides - 24 April 2014Partner Event Slides - 24 April 2014
Partner Event Slides - 24 April 2014
 
Scalable Web Applications Session at Codebase
Scalable Web Applications Session at CodebaseScalable Web Applications Session at Codebase
Scalable Web Applications Session at Codebase
 
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...
Indian Case Studies - How AWS Customers Have Successfully Built and Migrated ...
 
AWS re:Invent Recap from AWS User Group UK meetup #8
AWS re:Invent Recap from AWS User Group UK meetup #8AWS re:Invent Recap from AWS User Group UK meetup #8
AWS re:Invent Recap from AWS User Group UK meetup #8
 
AWS DevOps Event - Innovating with DevOps on AWS
AWS DevOps Event - Innovating with DevOps on AWSAWS DevOps Event - Innovating with DevOps on AWS
AWS DevOps Event - Innovating with DevOps on AWS
 
Security Best Practices
Security Best PracticesSecurity Best Practices
Security Best Practices
 
Amazon S3 Masterclass
Amazon S3 MasterclassAmazon S3 Masterclass
Amazon S3 Masterclass
 
Advanced Security Masterclass - Tel Aviv Loft
Advanced Security Masterclass - Tel Aviv LoftAdvanced Security Masterclass - Tel Aviv Loft
Advanced Security Masterclass - Tel Aviv Loft
 
Getting started with AWS Lambda and the Serverless Cloud
Getting started with AWS Lambda and the Serverless CloudGetting started with AWS Lambda and the Serverless Cloud
Getting started with AWS Lambda and the Serverless Cloud
 
Cost Optimisation with AWS
Cost Optimisation with AWSCost Optimisation with AWS
Cost Optimisation with AWS
 
AWS 101: Introduction to AWS
AWS 101: Introduction to AWSAWS 101: Introduction to AWS
AWS 101: Introduction to AWS
 

Similar to AWS CloudFormation Masterclass

Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationAmazon Web Services
 
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoDevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoAmazon Web Services
 
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Amazon Web Services
 
Managing Your Infrastructure as Code
Managing Your Infrastructure as CodeManaging Your Infrastructure as Code
Managing Your Infrastructure as CodeAmazon Web Services
 
AWS Cloud Formation
AWS Cloud FormationAWS Cloud Formation
AWS Cloud FormationMahesh Raj
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAmazon Web Services
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoAmazon Web Services
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeAmazon Web Services
 
CloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use casesCloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use casesWayland Zhang
 
Dev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudDev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudIan Massingham
 
Dev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudDev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudAmazon Web Services
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivAmazon Web Services
 
Amazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep DiveAmazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep DiveAmazon Web Services
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSFernando Rodriguez
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitDanilo Poccia
 

Similar to AWS CloudFormation Masterclass (20)

Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormation
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - TorontoDevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
DevOps on AWS: Deep Dive on Infrastructure as Code - Toronto
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
 
Managing Your Infrastructure as Code
Managing Your Infrastructure as CodeManaging Your Infrastructure as Code
Managing Your Infrastructure as Code
 
AWS Cloud Formation
AWS Cloud FormationAWS Cloud Formation
AWS Cloud Formation
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
 
CloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use casesCloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use cases
 
Dev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudDev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the Cloud
 
Dev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the CloudDev & Test on AWS - Journey Through the Cloud
Dev & Test on AWS - Journey Through the Cloud
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
Amazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep DiveAmazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep Dive
 
Scalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWSScalable and Fault-Tolerant Apps with AWS
Scalable and Fault-Tolerant Apps with AWS
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 

More from Ian Massingham

Some thoughts on measuring the impact of developer relations
Some thoughts on measuring the impact of developer relationsSome thoughts on measuring the impact of developer relations
Some thoughts on measuring the impact of developer relationsIan Massingham
 
Leeds IoT Meetup - Nov 2017
Leeds IoT Meetup - Nov 2017Leeds IoT Meetup - Nov 2017
Leeds IoT Meetup - Nov 2017Ian Massingham
 
What's New & What's Next from AWS?
What's New & What's Next from AWS?What's New & What's Next from AWS?
What's New & What's Next from AWS?Ian Massingham
 
DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
DevTalks Romania - Getting Started with AWS Lambda & the Serverless CloudDevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
DevTalks Romania - Getting Started with AWS Lambda & the Serverless CloudIan Massingham
 
AWS AWSome Day - Getting Started Best Practices
AWS AWSome Day - Getting Started Best PracticesAWS AWSome Day - Getting Started Best Practices
AWS AWSome Day - Getting Started Best PracticesIan Massingham
 
AWS IoT Workshop Keynote
AWS IoT Workshop KeynoteAWS IoT Workshop Keynote
AWS IoT Workshop KeynoteIan Massingham
 
Security Best Practices: AWS AWSome Day Management Track
Security Best Practices: AWS AWSome Day Management TrackSecurity Best Practices: AWS AWSome Day Management Track
Security Best Practices: AWS AWSome Day Management TrackIan Massingham
 
AWS re:Invent 2016 Day 2 Keynote re:Cap
AWS re:Invent 2016 Day 2 Keynote re:CapAWS re:Invent 2016 Day 2 Keynote re:Cap
AWS re:Invent 2016 Day 2 Keynote re:CapIan Massingham
 
AWS re:Invent 2016 Day 1 Keynote re:Cap
AWS re:Invent 2016 Day 1 Keynote re:CapAWS re:Invent 2016 Day 1 Keynote re:Cap
AWS re:Invent 2016 Day 1 Keynote re:CapIan Massingham
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudIan Massingham
 
Building Better IoT Applications without Servers
Building Better IoT Applications without ServersBuilding Better IoT Applications without Servers
Building Better IoT Applications without ServersIan Massingham
 
AWS AWSome Day Roadshow
AWS AWSome Day RoadshowAWS AWSome Day Roadshow
AWS AWSome Day RoadshowIan Massingham
 
AWS AWSome Day Roadshow Intro
AWS AWSome Day Roadshow IntroAWS AWSome Day Roadshow Intro
AWS AWSome Day Roadshow IntroIan Massingham
 
Hashiconf AWS Lambda Breakout
Hashiconf AWS Lambda BreakoutHashiconf AWS Lambda Breakout
Hashiconf AWS Lambda BreakoutIan Massingham
 
Getting started with AWS IoT on Raspberry Pi
Getting started with AWS IoT on Raspberry PiGetting started with AWS IoT on Raspberry Pi
Getting started with AWS IoT on Raspberry PiIan Massingham
 
AWSome Day Dublin Intro & Closing Slides
AWSome Day Dublin Intro & Closing Slides AWSome Day Dublin Intro & Closing Slides
AWSome Day Dublin Intro & Closing Slides Ian Massingham
 
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-end
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-endGOTO Stockholm - AWS Lambda - Logic in the cloud without a back-end
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-endIan Massingham
 
What's New at AWS Update for AWS User Groups
What's New at AWS Update for AWS User Groups What's New at AWS Update for AWS User Groups
What's New at AWS Update for AWS User Groups Ian Massingham
 
AWSome Day London January 2016 Intro
AWSome Day London January 2016 IntroAWSome Day London January 2016 Intro
AWSome Day London January 2016 IntroIan Massingham
 
AWS AWSome Day London October 2015
AWS AWSome Day London October 2015 AWS AWSome Day London October 2015
AWS AWSome Day London October 2015 Ian Massingham
 

More from Ian Massingham (20)

Some thoughts on measuring the impact of developer relations
Some thoughts on measuring the impact of developer relationsSome thoughts on measuring the impact of developer relations
Some thoughts on measuring the impact of developer relations
 
Leeds IoT Meetup - Nov 2017
Leeds IoT Meetup - Nov 2017Leeds IoT Meetup - Nov 2017
Leeds IoT Meetup - Nov 2017
 
What's New & What's Next from AWS?
What's New & What's Next from AWS?What's New & What's Next from AWS?
What's New & What's Next from AWS?
 
DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
DevTalks Romania - Getting Started with AWS Lambda & the Serverless CloudDevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
DevTalks Romania - Getting Started with AWS Lambda & the Serverless Cloud
 
AWS AWSome Day - Getting Started Best Practices
AWS AWSome Day - Getting Started Best PracticesAWS AWSome Day - Getting Started Best Practices
AWS AWSome Day - Getting Started Best Practices
 
AWS IoT Workshop Keynote
AWS IoT Workshop KeynoteAWS IoT Workshop Keynote
AWS IoT Workshop Keynote
 
Security Best Practices: AWS AWSome Day Management Track
Security Best Practices: AWS AWSome Day Management TrackSecurity Best Practices: AWS AWSome Day Management Track
Security Best Practices: AWS AWSome Day Management Track
 
AWS re:Invent 2016 Day 2 Keynote re:Cap
AWS re:Invent 2016 Day 2 Keynote re:CapAWS re:Invent 2016 Day 2 Keynote re:Cap
AWS re:Invent 2016 Day 2 Keynote re:Cap
 
AWS re:Invent 2016 Day 1 Keynote re:Cap
AWS re:Invent 2016 Day 1 Keynote re:CapAWS re:Invent 2016 Day 1 Keynote re:Cap
AWS re:Invent 2016 Day 1 Keynote re:Cap
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
 
Building Better IoT Applications without Servers
Building Better IoT Applications without ServersBuilding Better IoT Applications without Servers
Building Better IoT Applications without Servers
 
AWS AWSome Day Roadshow
AWS AWSome Day RoadshowAWS AWSome Day Roadshow
AWS AWSome Day Roadshow
 
AWS AWSome Day Roadshow Intro
AWS AWSome Day Roadshow IntroAWS AWSome Day Roadshow Intro
AWS AWSome Day Roadshow Intro
 
Hashiconf AWS Lambda Breakout
Hashiconf AWS Lambda BreakoutHashiconf AWS Lambda Breakout
Hashiconf AWS Lambda Breakout
 
Getting started with AWS IoT on Raspberry Pi
Getting started with AWS IoT on Raspberry PiGetting started with AWS IoT on Raspberry Pi
Getting started with AWS IoT on Raspberry Pi
 
AWSome Day Dublin Intro & Closing Slides
AWSome Day Dublin Intro & Closing Slides AWSome Day Dublin Intro & Closing Slides
AWSome Day Dublin Intro & Closing Slides
 
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-end
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-endGOTO Stockholm - AWS Lambda - Logic in the cloud without a back-end
GOTO Stockholm - AWS Lambda - Logic in the cloud without a back-end
 
What's New at AWS Update for AWS User Groups
What's New at AWS Update for AWS User Groups What's New at AWS Update for AWS User Groups
What's New at AWS Update for AWS User Groups
 
AWSome Day London January 2016 Intro
AWSome Day London January 2016 IntroAWSome Day London January 2016 Intro
AWSome Day London January 2016 Intro
 
AWS AWSome Day London October 2015
AWS AWSome Day London October 2015 AWS AWSome Day London October 2015
AWS AWSome Day London October 2015
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

AWS CloudFormation Masterclass

  • 1. Masterclass ianmas@amazon.com @IanMmmm Ian Massingham — Technical Evangelist AWS CloudFormation
  • 2. Masterclass Intended to educate you on how to get the best from AWS services Show you how things work and how to get things done A technical deep dive that goes beyond the basics
  • 3. AWS CloudFormation An easy way to create & manage a collection of AWS resources
 Allows orderly and predictable provisioning and updating of resources
 Allows you to version control your AWS infrastructure 
 Deploy and update stacks using console, command line or API
 You only pay for the resources you create
  • 4. AWS CloudFormation Don’t reinvent the wheel Declarative & Flexible Transparent and Open No Extra Charge Integration Ready Customized via Parameters
  • 5. CloudFormation - Components & Technology Template CloudFormation Stack JSON formatted file Parameter definition Resource creation Configuration actions Configured AWS services Comprehensive service support Service event aware Customisable Framework Stack creation Stack updates Error detection and rollback
  • 6. Agenda Creating Templates
 Using a Template to Create and Manage a Stack
 Working with the CloudFormation API
 Working with AWS Resources
 Bootstrapping Applications and Handling Updates
  • 8. CLOUDFORMATION TEMPLATES Familiar JSON Format ReusableManage Relationships Automate Generation Avoid Collisions Provide Feedback Write & GoLook Up Resources
  • 9. High Level Template Structure {          "Description"  :  "A  text  description  for  the  template  usage",          "Parameters":  {                  //  A  set  of  inputs  used  to  customize  the  template  per  deployment          },          "Resources"  :  {                  //  The  set  of  AWS  resources  and  relationships  between  them          },          "Outputs"  :  {                  //  A  set  of  values  to  be  made  visible  to  the  stack  creator          },          "AWSTemplateFormatVersion"  :  "2010-­‐09-­‐09”   }  
  • 10. A Simple Template that creates an EC2 Instance {        "Description":  "Create  an  EC2  instance  running  the  latest  Amazon  Linux  AMI.",        "Parameters":  {                "KeyPair":  {                        "Description":  "The  EC2  Key  Pair  to  allow  SSH  access  to  the  instance",                        "Type":  "String"                }        },        "Resources":  {                "Ec2Instance":  {                        "Properties":  {                                "ImageId":  "ami-­‐9d23aeea",                                "InstanceType"  :  "m3.medium",                                "KeyName":  {                                        "Ref":  "KeyPair"                                }                        },                        "Type":  "AWS::EC2::Instance"                }        },        "Outputs":  {                "InstanceId":  {                        "Description":  "The  InstanceId  of  the  newly  created  EC2  instance",                        "Value":  {                                "Ref":  "Ec2Instance"                        }                }        },   "AWSTemplateFormatVersion":  "2010-­‐09-­‐09" } You will be asked to enter values for these parameters when you create your stack
  • 11. A Simple Template that creates an EC2 Instance {        "Description":  "Create  an  EC2  instance  running  the  latest  Amazon  Linux  AMI.",        "Parameters":  {                "KeyPair":  {                        "Description":  "The  EC2  Key  Pair  to  allow  SSH  access  to  the  instance",                        "Type":  "String"                }        },        "Resources":  {                "Ec2Instance":  {                        "Properties":  {                                "ImageId":  "ami-­‐9d23aeea",                                "InstanceType"  :  "m3.medium",                                "KeyName":  {                                        "Ref":  "KeyPair"                                }                        },                        "Type":  "AWS::EC2::Instance"                }        },        "Outputs":  {                "InstanceId":  {                        "Description":  "The  InstanceId  of  the  newly  created  EC2  instance",                        "Value":  {                                "Ref":  "Ec2Instance"                        }                }        },   "AWSTemplateFormatVersion":  "2010-­‐09-­‐09" } Includes statically defined properties (ImageID & Instance Type) plus a reference to the KeyPair parameter. ImageID is the AMI specific to the region that you will launch this stack in, in this case the eu-west-1 region
  • 12. A Simple Template that creates an EC2 Instance {        "Description":  "Create  an  EC2  instance  running  the  latest  Amazon  Linux  AMI.",        "Parameters":  {                "KeyPair":  {                        "Description":  "The  EC2  Key  Pair  to  allow  SSH  access  to  the  instance",                        "Type":  "String"                }        },        "Resources":  {                "Ec2Instance":  {                        "Properties":  {                                "ImageId":  "ami-­‐9d23aeea",                                "InstanceType"  :  "m3.medium",                                "KeyName":  {                                        "Ref":  "KeyPair"                                }                        },                        "Type":  "AWS::EC2::Instance"                }        },        "Outputs":  {                "InstanceId":  {                        "Description":  "The  InstanceId  of  the  newly  created  EC2  instance",                        "Value":  {                                "Ref":  "Ec2Instance"                        }                }        },   "AWSTemplateFormatVersion":  "2010-­‐09-­‐09" } These outputs will be returned once the template has completed execution
  • 15. github.com/cloudtools/troposphere … but remember that a CloudFormation template is just JSON, so any tool that can generate output in JSON can be used
  • 17. Using a template to create and manage a stack
  • 18. Using a template to create and manage a stack
  • 19. Using a template to create and manage a stack
  • 20. Using a template to create and manage a stack
  • 21. Using a template to create and manage a stack
  • 22. Using a template to create and manage a stack
  • 23. Using a template to create and manage a stack
  • 24. Using a template to create and manage a stack
  • 25. Using a template to create and manage a stack
  • 26. Using a template to create and manage a stack
  • 27. Using a template to create and manage a stack
  • 28. Using a template to create and manage a stack
  • 29. Using a template to create and manage a stack
  • 30. Using a template to create and manage a stack
  • 31. IncorrectSyntax Using a template to create and manage a stack
  • 32. Using a template to create and manage a stack
  • 33. Using a template to create and manage a stack
  • 34. Using a template to create and manage a stack
  • 35. Provides Feedback Using a template to create and manage a stack
  • 36. Provides Feedback Using a template to create and manage a stack
  • 37. CorrectSyntax Using a template to create and manage a stack
  • 38. Using a template to create and manage a stack
  • 39. Replaces Resources Using a template to create and manage a stack
  • 40. Using a template to create and manage a stack
  • 41. Using a template to create and manage a stack
  • 42. Cleans Up Resources Using a template to create and manage a stack
  • 43. aws  cloudformation  create-­‐stack     -­‐-­‐stack-­‐name  ec2InstanceCmdLineDemo     -­‐-­‐template-­‐url  https://s3-­‐eu-­‐west-­‐1.amazonaws.com/cf-­‐ templates-­‐1fhelryvrdrbr-­‐eu-­‐west-­‐1/2014174d0r-­‐ec2Instance.template     -­‐-­‐parameters  ParameterKey=KeyPair,ParameterValue=ManagementKeyPair   arn:aws:cloudformation:eu-­‐west-­‐1:554625704737:stack/ec2InstanceCmdLineDemo/ 42cc6150-­‐fad7-­‐11e3-­‐8f4d-­‐5017e1aef4e7 Using a template to create and manage a stack via the AWS CLI Returns the details of the created stack, in the output format of your choice
  • 44. Using a template to create and manage a stack via the AWS CLI
  • 45. cancel-­‐update-­‐stack                get-­‐stack-­‐policy create-­‐stack                              get-­‐template delete-­‐stack                              list-­‐stack-­‐resources describe-­‐stack-­‐events            list-­‐stacks describe-­‐stack-­‐resource        set-­‐stack-­‐policy describe-­‐stack-­‐resources      update-­‐stack describe-­‐stacks                        validate-­‐template $  aws  cloudformation  update-­‐stack  help Other AWS CLI actions for CloudFormation As usual, you can get more details via the AWS CLI
  • 46. $  aws  cloudformation  update-­‐stack  help SYNOPSIS                        update-­‐stack                    -­‐-­‐stack-­‐name  <value>                    [-­‐-­‐template-­‐body  <value>]                    [-­‐-­‐template-­‐url  <value>]                    [-­‐-­‐use-­‐previous-­‐template  |  -­‐-­‐no-­‐use-­‐previous-­‐template]                    [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐body  <value>]                    [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐url  <value>]                    [-­‐-­‐parameters  <value>]                    [-­‐-­‐capabilities  <value>]                    [-­‐-­‐stack-­‐policy-­‐body  <value>]                    [-­‐-­‐stack-­‐policy-­‐url  <value>]                    [-­‐-­‐notification-­‐arns  <value>]   Help via the AWS CLI
  • 47. $  aws  cloudformation  update-­‐stack  help SYNOPSIS                        update-­‐stack                    -­‐-­‐stack-­‐name  <value>                    [-­‐-­‐template-­‐body  <value>]                    [-­‐-­‐template-­‐url  <value>]                    [-­‐-­‐use-­‐previous-­‐template  |  -­‐-­‐no-­‐use-­‐previous-­‐template]                    [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐body  <value>]                    [-­‐-­‐stack-­‐policy-­‐during-­‐update-­‐url  <value>]                    [-­‐-­‐parameters  <value>]                    [-­‐-­‐capabilities  <value>]                    [-­‐-­‐stack-­‐policy-­‐body  <value>]                    [-­‐-­‐stack-­‐policy-­‐url  <value>]                    [-­‐-­‐notification-­‐arns  <value>] Builtusing the CloudForm ation API CloudFormation API Reference : docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html
  • 48. WORKING WITH AWS RESOURCES
  • 49. Designed to use your existing experience with AWS Each resource has a set of parameters with names that are identical to the names used to create the resources through their native API Template reference: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html
  • 50. "myVolume"  :  {          "Type"  :  "AWS::EC2::Volume",          "Properties"  :  {                  "Size"  :  "10",                  "SnapshotId"  :  "snap-­‐7b8fd361",                  "AvailabilityZone"  :  "eu-­‐west-­‐1a"          }   }   This example defines an Amazon EBS Volume with a logical name ‘myVolume’. Its type is "AWS::EC2::Volume” If you’ve used EBS previously, the properties should look very familiar
  • 51. "InstanceSecurityGroup"  :  {              "Type"  :  "AWS::EC2::SecurityGroup",              "Properties"  :  {                  "GroupDescription"  :  "Enable  SSH  access  via  port  22",                  "SecurityGroupIngress"  :  [  {                      "IpProtocol"  :  "tcp",                      "FromPort"  :  "22",                      "ToPort"  :  "22",                      "CidrIp"  :  "0.0.0.0/0"                  }  ]              }          }   Creating a Security Group resource
  • 52. • Auto Scaling • Amazon CloudFront • AWS CloudWatch • Amazon DynamoDB • Amazon EC2 • Amazon ElastiCache • AWS Elastic Beanstalk • AWS Elastic Load Balancing • AWS Identity and Access Management • Amazon RDS • Amazon Redshift • Amazon Route 53 • Amazon S3 • Amazon SimpleDB • Amazon SNS • Amazon SQS • Amazon VPC Supported AWS Services:
  • 53. REFERENCING THE PROPERTIES OF ANOTHER RESOURCE
  • 54. {  "Resources"  :  {       "Ec2Instance"  :  {         "Type"  :  "AWS::EC2::Instance",      "Properties"  :  {           "SecurityGroups"  :  [  {  "Ref"  :  "InstanceSecurityGroup"  }  ],             "KeyName"  :  "mykey",       "ImageId"  :  "ami-­‐7a11e213”     }    },       "InstanceSecurityGroup"  :  {         "Type"  :  "AWS::EC2::SecurityGroup",      "Properties"  :  {           "GroupDescription"  :  "Enable  SSH  access  via  port  22",         "SecurityGroupIngress"  :  [  {               "IpProtocol"  :  "tcp",               "FromPort"  :  "22",               "ToPort"  :  "22",               "CidrIp"  :"0.0.0.0/0"  }  ]       }    }     }  } Reference Function
  • 55. {  "Resources"  :  {       "Ec2Instance"  :  {         "Type"  :  "AWS::EC2::Instance",     "Properties"  :  {         "SecurityGroups"  :  [  {  "Ref"  :  "InstanceSecurityGroup"  },  ,   "MyExistingSG"  ],     "KeyName"  :  "mykey",         "ImageId"  :  "ami-­‐7a11e213"  }    },       "InstanceSecurityGroup"  :  {         "Type"  :  "AWS::EC2::SecurityGroup",      "Properties"  :  {           "GroupDescription"  :  "Enable  SSH  access  via  port  22",         "SecurityGroupIngress"  :  [  {           "IpProtocol"  :  "tcp",             "FromPort"  :  "22",             "ToPort"  :  "22",             "CidrIp"  :"0.0.0.0/0"  }  ]       }    }     }  } Literal References
  • 57. { "Parameters"  :  {   "KeyPair"  :  {       "Description"  :  "The  EC2  Key  Pair  to  allow  SSH  access  to  the  instance",       "Type"  :  "String"     }, "Resources"  :  {         "Ec2Instance"  :  {         "Type"  :  "AWS::EC2::Instance",      "Properties"  :  {           "SecurityGroups"  :  [  {  "Ref"  :  "InstanceSecurityGroup"  }],           "KeyName"  :  {  "Ref"  :  "KeyPair"},         "ImageId"  :  ""  }    },     …     }  } Input Param eters
  • 59. "WordPressUser":  {   "Default":  "admin",     "Description"  :  "The  WordPress  database  admin  account  username",     "Type":  "String",       "MinLength":  "1",       "MaxLength":  "16",       "AllowedPattern"  :  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*"     }, Validate your input parameters with : Maxlength, MinLength, MaxValue, MinValue, AllowedPattern, AllowedValues Input Param eters
  • 61. {"Mappings"  :  {      "RegionMap"  :  {           "us-­‐east-­‐1"  :  {  "AMI"  :  "ami-­‐76f0061f"  },       "us-­‐west-­‐1"  :  {  "AMI"  :  "ami-­‐655a0a20"  },           "eu-­‐west-­‐1"  :  {  "AMI"  :  "ami-­‐7fd4e10b"  },           "ap-­‐southeast-­‐1"  :  {  "AMI"  :  "ami-­‐72621c20"  },       "ap-­‐northeast-­‐1"  :  {  "AMI"  :  "ami-­‐8e08a38f"  }  }  },  "Resources"  :  {       "Ec2Instance"  :  {   "Type"  :  "AWS::EC2::Instance",       "Properties"  :  {         "KeyName"  :  {  "Ref"  :  "KeyName"  },         “ImageId"  :  {           "Fn::FindInMap"  :  [  "RegionMap",  {  "Ref"  :  "AWS::Region"  },  "AMI"  ]}      }   }   }  } M appings
  • 62. Other intrinsic functions and pseudo parameters Pseudo parameters AWS::NotificationARNs AWS::Region AWS::StackId AWS::StackName Intrinsic functions Fn::Base64 Fn::FindInMap Fn::GetAtt Fn::GetAZs Fn::Join Fn::Select Ref
  • 63. Working with non-AWS Resources Defining custom resources allows you to include non-AWS resources in a CloudFormation stack More on Custom Resources in ‘AWS CloudFormation under the Hood’ from re:Invent 2013: http://youtu.be/ZhGMaw67Yu0 AWS CloudFormation Custom Resource Walkthrough documentation: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-walkthrough.html
  • 65. "Resources"  :  {          "Ec2Instance"  :  {              "Type"  :  "AWS::EC2::Instance",              "Properties"  :  {                  "KeyName"  :  {  "Ref"  :  "KeyName"  },                  "SecurityGroups"  :  [  {  "Ref"  :  "InstanceSecurityGroup"  }  ],                  "ImageId"  :  {  "Fn::FindInMap"  :  [  "RegionMap",  {  "Ref"  :  "AWS::Region"  },  "AMI"  ]},                  "UserData"  :  {  "Fn::Base64"  :  {  "Fn::Join"  :  ["",[                          "#!/bin/bash  -­‐ex","n",                          "yum  -­‐y  install  gcc-­‐c++  make","n",                          "yum  -­‐y  install  mysql-­‐devel  sqlite-­‐devel","n",                          "yum  -­‐y  install  ruby-­‐rdoc  rubygems  ruby-­‐mysql  ruby-­‐devel","n",                          "gem  install  -­‐-­‐no-­‐ri  -­‐-­‐no-­‐rdoc  rails","n",                          "gem  install  -­‐-­‐no-­‐ri  -­‐-­‐no-­‐rdoc  mysql","n",                          "gem  install  -­‐-­‐no-­‐ri  -­‐-­‐no-­‐rdoc  sqlite3","n",                          "rails  new  myapp","n",                          "cd  myapp","n",                          "rails  server  -­‐d","n",                          "curl  -­‐X  PUT  -­‐H  'Content-­‐Type:'  -­‐-­‐data-­‐binary  '{"Status"  :  "SUCCESS",",                                                                                                                        ""Reason"  :  "The  application  myapp  is  ready",",                                                                                                                        ""UniqueId"  :  "myapp",",                                                                                                                        ""Data"  :  "Done"}'  ",                                      """,  {"Ref"  :  "WaitForInstanceWaitHandle"},""n"  ]]}}              }          } Option 1: Continue to use EC2 UserData, which is available as a property of AWS::EC2::Instance resources
  • 66. cfn-hup cfn-signal cfn-get-metadata Amazon EC2AWS CloudFormation cfn-init Metadata Key — AWS::CloudFormation::Init   Cfn-init reads this metadata key and installs the packages listed in this key (e.g., httpd, mysql, and php). Cfn-init also retrieves and expands files listed as sources. Option 2: AWS CloudFormation provides helper scripts for deployment within your EC2 instances
  • 67. "Resources"  :  {          "WebServer":  {              "Type":  "AWS::EC2::Instance",              "Metadata"  :  {                  "Comment1"  :  "Configure  the  bootstrap  helpers  to  install  the  Apache  Web  Server  and  PHP",                  "Comment2"  :  "The  website  content  is  downloaded  from  the  CloudFormationPHPSample.zip  file",                  "AWS::CloudFormation::Init"  :  {                      "config"  :  {                          "packages"  :  {                              "yum"  :  {                                  "mysql"                :  [],                                  "mysql-­‐server"  :  [],                                  "mysql-­‐libs"      :  [],                                  "httpd"                :  [],                                  "php"                    :  [],                                  "php-­‐mysql"        :  []                              }                          },                          "sources"  :  {                              "/var/www/html"  :  "https://s3.amazonaws.com/cloudformation-­‐examples/CloudFormationPHPSample.zip"                          }                      }                  }              } Installing Packages & Expanding Files
  • 68.  "Properties":  {                  "ImageId"  :  {  "Fn::FindInMap"  :  [  "AWSRegionArch2AMI",  {  "Ref"  :  "AWS::Region"  },                                                      {  "Fn::FindInMap"  :  [  "AWSInstanceType2Arch",  {  "Ref"  :  "InstanceType"  },  "Arch"  ]  }  ]  },                  "InstanceType"      :  {  "Ref"  :  "InstanceType"  },                  "SecurityGroups"  :  [  {"Ref"  :  "WebServerSecurityGroup"}  ],                  "KeyName"                :  {  "Ref"  :  "KeyName"  },                  "UserData"              :  {  "Fn::Base64"  :  {  "Fn::Join"  :  ["",  [                      "#!/bin/bash  -­‐vn",                      "yum  update  -­‐y  aws-­‐cfn-­‐bootstrapn",                      "#  Install  packagesn",                      "/opt/aws/bin/cfn-­‐init  -­‐s  ",  {  "Ref"  :  "AWS::StackName"  },  "  -­‐r  WebServer  ",                      "        -­‐-­‐region  ",  {  "Ref"  :  "AWS::Region"  },  "  ||  error_exit  'Failed  to  run  cfn-­‐init'n"          ]]}}                              }          }, The UserData key allows you to execute shell commands. This template issues two shell commands: the first command installs the AWS CloudFormation helper scripts; the second executes the cfn-init script. Installing & executing CloudForm ation helper
  • 69.  "files"  :  {                              "/tmp/setup.mysql"  :  {                                  "content"  :  {  "Fn::Join"  :  ["",  [                                      "CREATE  DATABASE  ",  {  "Ref"  :  "DBName"  },  ";n",                                      "GRANT  ALL  ON  ",  {  "Ref"  :  "DBName"  },  ".*  TO  '",  {  "Ref"  :  "DBUsername"  },  "'@localhost  IDENTIFIED  BY   '",  {  "Ref"  :  "DBPassword"  },  "';n"                                      ]]},                                  "mode"    :  "000644",                                  "owner"  :  "root",                                  "group"  :  "root"                              }                          } The files key allows you to write files to the instance filesystem Creating files on Instance Filesystem s
  • 70. "services"  :  {                              "sysvinit"  :  {                                  "mysqld"  :  {                                      "enabled"              :  "true",                                      "ensureRunning"  :  "true"                                  },                                  "httpd"  :  {                                      "enabled"              :  "true",                                      "ensureRunning"  :  "true"                                  }                              } The services key allows you ensures that the services are not only running when cfn-init finishes (ensureRunning is set to true); but that they are also restarted upon reboot (enabled is set to true). Controlling Services More on Deploying Applications with AWS CloudFormation: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/deploying.applications.html
  • 71. Yes! All this functionality is available for Windows instances too! Bootstrapping AWS CloudFormation Windows Stacks: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-windows-stacks-bootstrapping.html
  • 72. Find out more here: aws.amazon.com/cloudformation/aws-cloudformation-articles-and-tutorials/ What about Chef? and/or What about Puppet?
  • 74. An easy way to create & manage a collection of AWS resources1 Allows orderly and predictable provisioning and updating of resources2 Allows you to version control your AWS infrastructure3 Deploy and update stacks using console, command line or API4
  • 75. RESOURCES YOU CAN USE TO LEARN MORE
  • 77. Getting Started with AWS CloudFormation: aws.amazon.com/cloudformation/getting-started/ AWS CloudFormation Templates & Samples: aws.amazon.com/cloudformation/aws-cloudformation-templates/ AWS cfncluster HPC deployment framework: github.com/awslabs/cfncluster/
  • 78. {      "AWSTemplateFormatVersion"  :  "2010-­‐09-­‐09",      "Description"  :  "AWS  CloudFormation  Sample  Template  WordPress_Multi_AZ:  WordPress  is  web  software  you  can  use  to  create  a  beautiful  website  or  blog.  This  template   installs  a  highly-­‐available,  scalable  WordPress  deployment  using  a  multi-­‐az  Amazon  RDS  database  instance  for  storage.  It  demonstrates  using  the  AWS  CloudFormation  bootstrap   scripts  to  deploy  WordPress.  **WARNING**  This  template  creates  an  Amazon  EC2  instance,  an  Elastic  Load  Balancer  and  an  Amazon  RDS  database  instance.  You  will  be  billed  for   the  AWS  resources  used  if  you  create  a  stack  from  this  template.",      "Parameters"  :  {          "KeyName":  {              "Description"  :  "Name  of  an  existing  EC2  KeyPair  to  enable  SSH  access  to  the  instances",              "Type":  "AWS::EC2::KeyPair::KeyName",              "ConstraintDescription"  :  "must  be  the  name  of  an  existing  EC2  KeyPair."          },          "InstanceType"  :  {              "Description"  :  "WebServer  EC2  instance  type",              "Type"  :  "String",              "Default"  :  "m1.small",              "AllowedValues"  :  [  "t1.micro",  "t2.micro",  "t2.small",  "t2.medium",  "m1.small",  "m1.medium",  "m1.large",  "m1.xlarge",  "m2.xlarge",  "m2.2xlarge",  "m2.4xlarge",   "m3.medium",  "m3.large",  "m3.xlarge",  "m3.2xlarge",  "c1.medium",  "c1.xlarge",  "c3.large",  "c3.xlarge",  "c3.2xlarge",  "c3.4xlarge",  "c3.8xlarge",  "c4.large",  "c4.xlarge",   "c4.2xlarge",  "c4.4xlarge",  "c4.8xlarge",  "g2.2xlarge",  "r3.large",  "r3.xlarge",  "r3.2xlarge",  "r3.4xlarge",  "r3.8xlarge",  "i2.xlarge",  "i2.2xlarge",  "i2.4xlarge",   "i2.8xlarge",  "hi1.4xlarge",  "hs1.8xlarge",  "cr1.8xlarge",  "cc2.8xlarge",  "cg1.4xlarge"]   ,              "ConstraintDescription"  :  "must  be  a  valid  EC2  instance  type."          },          "SSHLocation":  {              "Description":  "The  IP  address  range  that  can  be  used  to  SSH  to  the  EC2  instances",              "Type":  "String",              "MinLength":  "9",              "MaxLength":  "18",              "Default":  "0.0.0.0/0",              "AllowedPattern":  "(d{1,3}).(d{1,3}).(d{1,3}).(d{1,3})/(d{1,2})",              "ConstraintDescription":  "must  be  a  valid  IP  CIDR  range  of  the  form  x.x.x.x/x."          },          "DBClass"  :  {              "Description"  :  "Database  instance  class",              "Type"  :  "String",              "Default"  :  "db.m1.small",              "AllowedValues"  :  [  "db.t1.micro",  "db.m1.small",  "db.m1.medium",  "db.m1.large",  "db.m1.xlarge",  "db.m2.xlarge",  "db.m2.2xlarge",  "db.m2.4xlarge",  "db.m3.medium",   "db.m3.large",  "db.m3.xlarge",  "db.m3.2xlarge",  "db.r3.large",  "db.r3.xlarge",  "db.r3.2xlarge",  "db.r3.4xlarge",  "db.r3.8xlarge",  "db.m2.xlarge",  "db.m2.2xlarge",   "db.m2.4xlarge",  "db.cr1.8xlarge"]   ,              "ConstraintDescription"  :  "must  select  a  valid  database  instance  type."          },          "DBName"  :  {              "Default":  "wordpressdb",              "Description"  :  "The  WordPress  database  name",              "Type":  "String",              "MinLength":  "1",              "MaxLength":  "64",              "AllowedPattern"  :  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*",              "ConstraintDescription"  :  "must  begin  with  a  letter  and  contain  only  alphanumeric  characters."          },          "DBUser"  :  {              "NoEcho":  "true",              "Description"  :  "The  WordPress  database  admin  account  username",              "Type":  "String",              "MinLength":  "1",              "MaxLength":  "16",              "AllowedPattern"  :  "[a-­‐zA-­‐Z][a-­‐zA-­‐Z0-­‐9]*",              "ConstraintDescription"  :  "must  begin  with  a  letter  and  contain  only  alphanumeric  characters."          },          "DBPassword"  :  {              "NoEcho":  "true",              "Description"  :  "The  WordPress  database  admin  account  password",              "Type":  "String",              "MinLength":  "8",              "MaxLength":  "41",              "AllowedPattern"  :  "[a-­‐zA-­‐Z0-­‐9]*",              "ConstraintDescription"  :  "must  contain  only  alphanumeric  characters."          },          "MultiAZDatabase":  {              "Default":  "false",              "Description"  :  "Create  a  Multi-­‐AZ  MySQL  Amazon  RDS  database  instance",              "Type":  "String",              "AllowedValues"  :  [  "true",  "false"  ],              "ConstraintDescription"  :  "must  be  either  true  or  false."          },          "WebServerCapacity":  {              "Default":  "1",              "Description"  :  "The  initial  number  of  WebServer  instances",              "Type":  "Number",              "MinValue":  "1",              "MaxValue":  "5",              "ConstraintDescription"  :  "must  be  between  1  and  5  EC2  instances."          },          "DBAllocatedStorage"  :  {              "Default":  "5",              "Description"  :  "The  size  of  the  database  (Gb)",              "Type":  "Number",              "MinValue":  "5",              "MaxValue":  "1024",              "ConstraintDescription"  :  "must  be  between  5  and  1024Gb."          }      },      "Mappings"  :  {          "AWSInstanceType2Arch"  :  {              "t1.micro"        :  {  "Arch"  :  "PV64"      },              "t2.micro"        :  {  "Arch"  :  "HVM64"    },              "t2.small"        :  {  "Arch"  :  "HVM64"    },              "t2.medium"      :  {  "Arch"  :  "HVM64"    },              "m1.small"        :  {  "Arch"  :  "PV64"      },              "m1.medium"      :  {  "Arch"  :  "PV64"      },              "m1.large"        :  {  "Arch"  :  "PV64"      },              "m1.xlarge"      :  {  "Arch"  :  "PV64"      },              "m2.xlarge"      :  {  "Arch"  :  "PV64"      },              "m2.2xlarge"    :  {  "Arch"  :  "PV64"      },              "m2.4xlarge"    :  {  "Arch"  :  "PV64"      },              "m3.medium"      :  {  "Arch"  :  "HVM64"    },              "m3.large"        :  {  "Arch"  :  "HVM64"    },              "m3.xlarge"      :  {  "Arch"  :  "HVM64"    },              "m3.2xlarge"    :  {  "Arch"  :  "HVM64"    },              "c1.medium"      :  {  "Arch"  :  "PV64"      },              "c1.xlarge"      :  {  "Arch"  :  "PV64"      },              "c3.large"        :  {  "Arch"  :  "HVM64"    },              "c3.xlarge"      :  {  "Arch"  :  "HVM64"    },              "c3.2xlarge"    :  {  "Arch"  :  "HVM64"    },              "c3.4xlarge"    :  {  "Arch"  :  "HVM64"    },              "c3.8xlarge"    :  {  "Arch"  :  "HVM64"    },              "c4.large"        :  {  "Arch"  :  "HVM64"    },              "c4.xlarge"      :  {  "Arch"  :  "HVM64"    },              "c4.2xlarge"    :  {  "Arch"  :  "HVM64"    },              "c4.4xlarge"    :  {  "Arch"  :  "HVM64"    },              "c4.8xlarge"    :  {  "Arch"  :  "HVM64"    },              "g2.2xlarge"    :  {  "Arch"  :  "HVMG2"    },              "r3.large"        :  {  "Arch"  :  "HVM64"    },              "r3.xlarge"      :  {  "Arch"  :  "HVM64"    },              "r3.2xlarge"    :  {  "Arch"  :  "HVM64"    },              "r3.4xlarge"    :  {  "Arch"  :  "HVM64"    },              "r3.8xlarge"    :  {  "Arch"  :  "HVM64"    },              "i2.xlarge"      :  {  "Arch"  :  "HVM64"    },              "i2.2xlarge"    :  {  "Arch"  :  "HVM64"    },              "i2.4xlarge"    :  {  "Arch"  :  "HVM64"    },              "i2.8xlarge"    :  {  "Arch"  :  "HVM64"    },              "hi1.4xlarge"  :  {  "Arch"  :  "HVM64"    },              "hs1.8xlarge"  :  {  "Arch"  :  "HVM64"    },              "cr1.8xlarge"  :  {  "Arch"  :  "HVM64"    },              "cc2.8xlarge"  :  {  "Arch"  :  "HVM64"    }          }   ,          "AWSRegionArch2AMI"  :  {              "us-­‐east-­‐1"                :  {"PV64"  :  "ami-­‐8e682ce6",  "HVM64"  :  "ami-­‐146e2a7c",  "HVMG2"  :  "ami-­‐7200461a"},              "us-­‐west-­‐2"                :  {"PV64"  :  "ami-­‐9fc29baf",  "HVM64"  :  "ami-­‐dfc39aef",  "HVMG2"  :  "ami-­‐0b78203b"},              "us-­‐west-­‐1"                :  {"PV64"  :  "ami-­‐f49089b1",  "HVM64"  :  "ami-­‐42908907",  "HVMG2"  :  "ami-­‐244b5361"},              "eu-­‐west-­‐1"                :  {"PV64"  :  "ami-­‐7b3db00c",  "HVM64"  :  "ami-­‐9d23aeea",  "HVMG2"  :  "ami-­‐4d7cf03a"},              "eu-­‐central-­‐1"          :  {"PV64"  :  "ami-­‐0600331b",  "HVM64"  :  "ami-­‐04003319",  "HVMG2"  :  "NOT_SUPPORTED"},              "ap-­‐northeast-­‐1"      :  {"PV64"  :  "ami-­‐3c87993d",  "HVM64"  :  "ami-­‐18869819",  "HVMG2"  :  "ami-­‐2e90892f"},              "ap-­‐southeast-­‐1"      :  {"PV64"  :  "ami-­‐58ba910a",  "HVM64"  :  "ami-­‐96bb90c4",  "HVMG2"  :  "ami-­‐3e78526c"},              "ap-­‐southeast-­‐2"      :  {"PV64"  :  "ami-­‐1500742f",  "HVM64"  :  "ami-­‐d50773ef",  "HVMG2"  :  "ami-­‐315e2a0b"},              "sa-­‐east-­‐1"                :  {"PV64"  :  "ami-­‐fd9925e0",  "HVM64"  :  "ami-­‐af9925b2",  "HVMG2"  :  "NOT_SUPPORTED"},              "cn-­‐north-­‐1"              :  {"PV64"  :  "ami-­‐8a1d8fb3",  "HVM64"  :  "ami-­‐981d8fa1",  "HVMG2"  :  "NOT_SUPPORTED"}          }      },      "Conditions"  :  {          "Is-­‐EC2-­‐VPC"          :  {  "Fn::Or"  :  [  {"Fn::Equals"  :  [{"Ref"  :  "AWS::Region"},  "eu-­‐central-­‐1"  ]},                                                                              {"Fn::Equals"  :  [{"Ref"  :  "AWS::Region"},  "cn-­‐north-­‐1"  ]}]},          "Is-­‐EC2-­‐Classic"  :  {  "Fn::Not"  :  [{  "Condition"  :  "Is-­‐EC2-­‐VPC"}]}      },      "Resources"  :  {          "ElasticLoadBalancer"  :  {              "Type"  :  "AWS::ElasticLoadBalancing::LoadBalancer",              "Properties"  :  {                  "AvailabilityZones"  :  {  "Fn::GetAZs"  :  ""  },                  "CrossZone"  :  "true",                  "LBCookieStickinessPolicy"  :  [  {                      "PolicyName"  :  "CookieBasedPolicy",                      "CookieExpirationPeriod"  :  "30"                  }  ],                  "Listeners"  :  [  {                      "LoadBalancerPort"  :  "80",                      "InstancePort"  :  "80",                      "Protocol"  :  "HTTP",                      "PolicyNames"  :  [  "CookieBasedPolicy"  ]                  }  ],                  "HealthCheck"  :  {                      "Target"  :  "HTTP:80/wordpress/wp-­‐admin/install.php",                      "HealthyThreshold"  :  "2",                      "UnhealthyThreshold"  :  "5",                      "Interval"  :  "10",                      "Timeout"  :  "5"                  }              }          },          "WebServerSecurityGroup"  :  {              "Type"  :  "AWS::EC2::SecurityGroup",              "Properties"  :  {                  "GroupDescription"  :  "Enable  HTTP  access  via  port  80  locked  down  to  the  load  balancer  +  SSH  access",                  "SecurityGroupIngress"  :  [                      {"IpProtocol"  :  "tcp",  "FromPort"  :  "80",  "ToPort"  :  "80",  "SourceSecurityGroupOwnerId"  :  {"Fn::GetAtt"  :  ["ElasticLoadBalancer",   "SourceSecurityGroup.OwnerAlias"]},"SourceSecurityGroupName"  :  {"Fn::GetAtt"  :  ["ElasticLoadBalancer",  "SourceSecurityGroup.GroupName"]}},                      {"IpProtocol"  :  "tcp",  "FromPort"  :  "22",  "ToPort"  :  "22",  "CidrIp"  :  {  "Ref"  :  "SSHLocation"}}                  ]              }          },          "WebServerGroup"  :  {              "Type"  :  "AWS::AutoScaling::AutoScalingGroup",              "Properties"  :  {                  "AvailabilityZones"  :  {  "Fn::GetAZs"  :  ""  },                  "LaunchConfigurationName"  :  {  "Ref"  :  "LaunchConfig"  },                  "MinSize"  :  "1",                  "MaxSize"  :  "5",                  "DesiredCapacity"  :  {  "Ref"  :  "WebServerCapacity"  },                  "LoadBalancerNames"  :  [  {  "Ref"  :  "ElasticLoadBalancer"  }  ]              },              "CreationPolicy"  :  {                  "ResourceSignal"  :  {                      "Timeout"  :  "PT15M"                  }              },              "UpdatePolicy":  {                  "AutoScalingRollingUpdate":  {                      "MinInstancesInService":  "1",                      "MaxBatchSize":  "1",                      "PauseTime"  :  "PT15M",                      "WaitOnResourceSignals":  "true"                  }              }          },          "LaunchConfig":  {              "Type"  :  "AWS::AutoScaling::LaunchConfiguration",              "Metadata"  :  {                  "AWS::CloudFormation::Init"  :  {                      "configSets"  :  {                          "wordpress_install"  :  ["install_cfn",  "install_wordpress"  ]                      },                      "install_cfn"  :  {                          "files":  {                              "/etc/cfn/cfn-­‐hup.conf":  {                                  "content":  {  "Fn::Join":  [  "",  [                                      "[main]n",                                      "stack=",  {  "Ref":  "AWS::StackId"  },  "n",                                      "region=",  {  "Ref":  "AWS::Region"  },  "n"                                  ]]},                                  "mode"    :  "000400",                                  "owner"  :  "root",                                  "group"  :  "root"                              },                              "/etc/cfn/hooks.d/cfn-­‐auto-­‐reloader.conf":  {                                  "content":  {  "Fn::Join":  [  "",  [                                      "[cfn-­‐auto-­‐reloader-­‐hook]n",                                      "triggers=post.updaten",                                      "path=Resources.LaunchConfig.Metadata.AWS::CloudFormation::Initn",                                      "action=/opt/aws/bin/cfn-­‐init  -­‐v  ",                                                      "                  -­‐-­‐stack  ",  {  "Ref"  :  "AWS::StackName"  },                                                      "                  -­‐-­‐resource  LaunchConfig  ",                                                      "                  -­‐-­‐configsets  wordpress_install  ",                                                      "                  -­‐-­‐region  ",  {  "Ref"  :  "AWS::Region"  },  "n"                                  ]]},                                                      "mode"    :  "000400",                                  "owner"  :  "root",                                  "group"  :  "root"                              }                          },                          "services"  :  {                              "sysvinit"  :  {                                  "cfn-­‐hup"  :  {  "enabled"  :  "true",  "ensureRunning"  :  "true",                                                              "files"  :  ["/etc/cfn/cfn-­‐hup.conf",  "/etc/cfn/hooks.d/cfn-­‐auto-­‐reloader.conf"]}                              }                          }                      },                      "install_wordpress"  :  {                          "packages"  :  {                              "yum"  :  {                                  "php"              :  [],                                  "php-­‐mysql"  :  [],                                  "mysql"          :  [],                                  "httpd"          :  []                              }                          },                          "sources"  :  {                              "/var/www/html"  :  "http://wordpress.org/latest.tar.gz"                          },                          "files"  :  {                              "/tmp/create-­‐wp-­‐config"  :  {                                  "content"  :  {  "Fn::Join"  :  [  "",  [                                      "#!/bin/bashn",                                      "cp  /var/www/html/wordpress/wp-­‐config-­‐sample.php  /var/www/html/wordpress/wp-­‐config.phpn",                                      "sed  -­‐i  "s/'database_name_here'/'",{  "Ref"  :  "DBName"  },  "'/g"  wp-­‐config.phpn",                                      "sed  -­‐i  "s/'username_here'/'",{  "Ref"  :  "DBUser"  },  "'/g"  wp-­‐config.phpn",                                      "sed  -­‐i  "s/'password_here'/'",{  "Ref"  :  "DBPassword"  },  "'/g"  wp-­‐config.phpn",                                      "sed  -­‐i  "s/'localhost'/'",{  "Fn::GetAtt"  :  [  "DBInstance",  "Endpoint.Address"  ]  },  "'/g"  wp-­‐config.phpn"                                  ]]},                                  "mode"  :  "000500",                                  "owner"  :  "root",                                  "group"  :  "root"                              }                          },                          "commands"  :  {                              "01_configure_wordpress"  :  {                                  "command"  :  "/tmp/create-­‐wp-­‐config",                                  "cwd"  :  "/var/www/html/wordpress"                              }                          },                          "services"  :  {                              "sysvinit"  :  {                                  "httpd"  :  {  "enabled"  :  "true",  "ensureRunning"  :  "true"  }                              }                          }                      }                  }              },              "Properties":  {                  "ImageId"  :  {  "Fn::FindInMap"  :  [  "AWSRegionArch2AMI",  {  "Ref"  :  "AWS::Region"  },                                                      {  "Fn::FindInMap"  :  [  "AWSInstanceType2Arch",  {  "Ref"  :  "InstanceType"  },  "Arch"  ]  }  ]  },                  "InstanceType"      :  {  "Ref"  :  "InstanceType"  },                  "SecurityGroups"  :  [  {"Ref"  :  "WebServerSecurityGroup"}  ],                  "KeyName"                :  {  "Ref"  :  "KeyName"  },                  "UserData"  :  {  "Fn::Base64"  :  {  "Fn::Join"  :  ["",  [                                                "#!/bin/bash  -­‐xen",                                                "yum  update  -­‐y  aws-­‐cfn-­‐bootstrapn",                                                "/opt/aws/bin/cfn-­‐init  -­‐v  ",                                                "                  -­‐-­‐stack  ",  {  "Ref"  :  "AWS::StackName"  },                                                "                  -­‐-­‐resource  LaunchConfig  ",                                                "                  -­‐-­‐configsets  wordpress_install  ",                                                "                  -­‐-­‐region  ",  {  "Ref"  :  "AWS::Region"  },  "n",                                                "/opt/aws/bin/cfn-­‐signal  -­‐e  $?  ",                                                "                  -­‐-­‐stack  ",  {  "Ref"  :  "AWS::StackName"  },                                                "                  -­‐-­‐resource  WebServerGroup  ",                                                "                  -­‐-­‐region  ",  {  "Ref"  :  "AWS::Region"  },  "n"                  ]]}}              }          },          "DBSecurityGroup":  {              "Type":  "AWS::RDS::DBSecurityGroup",              "Condition"  :  "Is-­‐EC2-­‐Classic",              "Properties":  {                  "DBSecurityGroupIngress":  {                      "EC2SecurityGroupName":  {  "Ref":  "WebServerSecurityGroup"  }                  },                  "GroupDescription":  "database  access"              }          },          "DBEC2SecurityGroup":  {              "Type":  "AWS::EC2::SecurityGroup",              "Condition"  :  "Is-­‐EC2-­‐VPC",              "Properties"  :  {                  "GroupDescription":  "Open  database  for  access",                  "SecurityGroupIngress"  :  [{                      "IpProtocol"  :  "tcp",                      "FromPort"  :  "3306",                      "ToPort"  :  "3306",                      "SourceSecurityGroupName"  :  {  "Ref"  :  "WebServerSecurityGroup"  }                  }]              }          },          "DBInstance"  :  {              "Type":  "AWS::RDS::DBInstance",              "Properties":  {                  "DBName"                        :  {  "Ref"  :  "DBName"  },                  "Engine"                        :  "MySQL",                  "MultiAZ"                      :  {  "Ref":  "MultiAZDatabase"  },                  "MasterUsername"        :  {  "Ref"  :  "DBUser"  },                  "MasterUserPassword":  {  "Ref"  :  "DBPassword"  },                  "DBInstanceClass"      :  {  "Ref"  :  "DBClass"  },                  "AllocatedStorage"    :  {  "Ref"  :  "DBAllocatedStorage"  },                  "VPCSecurityGroups":  {  "Fn::If"  :  [  "Is-­‐EC2-­‐VPC",  [  {  "Fn::GetAtt":  [  "DBEC2SecurityGroup",  "GroupId"  ]  }  ],  {  "Ref"  :  "AWS::NoValue"}]},                  "DBSecurityGroups":  {  "Fn::If"  :  [  "Is-­‐EC2-­‐Classic",  [  {  "Ref":  "DBSecurityGroup"  }  ],  {  "Ref"  :  "AWS::NoValue"}]}              }          }      },      "Outputs"  :  {          "WebsiteURL"  :  {              "Value"  :  {  "Fn::Join"  :  ["",  ["http://",  {  "Fn::GetAtt"  :  [  "ElasticLoadBalancer",  "DNSName"  ]},  "/wordpress"  ]]},              "Description"  :  "WordPress  Website"          }      }   } CloudFormation Template to Deploy Wordpress https://s3-us-west-1.amazonaws.com/cloudformation-templates-us-west-1/WordPress_Multi_AZ.template
  • 79. Certification aws.amazon.com/certification Self-Paced Labs aws.amazon.com/training/
 self-paced-labs Try products, gain new skills, and get hands-on practice working with AWS technologies aws.amazon.com/training Training Validate your proven skills and expertise with the AWS platform Build technical expertise to design and operate scalable, efficient applications on AWS AWS Training & Certification
  • 80. LONDON 15 APRIL 2015 aws.amazon.com/summits/london/ AWS CloudFormation will be featured in the Deep Dive: Infrastructure-as-Code breakout session
  • 81. Follow us for m ore events & w ebinars @AWScloud for Global AWS News & Announcements @AWS_UKI for local AWS events & news @IanMmmm Ian Massingham — Technical Evangelist