WELCOME!• Objective: provide a brief for launching a load-balanced
LAMP stack on Amazon CloudFormation.
AN INTRODUCTION TO “SERVERS”
THE CLOUD = THE FUTURE• “Everyone is going there.”
• “It’s old-fashioned to have your own server.”
• “Complete redundancy in the cloud.”
• “Dirt cheap.”
THE CLOUD• A server
• A physical machine
• Shutdown turns off the
machine
• Indispensable
• An instance
• One or more machines
joined and then divided
• “Shutdown” disables or
destroys the instance
• Disposable
AWS OVERVIEW• EC2: server instances
• EBS: elastic block storage, or a “removable” hard drive
• Elastic IP: pointing an IP address at an instance.
• ELB: load balancer
• S3: storage
AWS OVERVIEW• RDS: managed database
• VPC: virtual private cloud
• Route 53: DNS
GETTING STARTED• Need an AWS account
• Free Tier (1cpu, 1gb RAM)
GETTING STARTED• Launch an instance:
• Go through wizard.
• SSH into instance.
• Download Apache, MySQL, PHP.
• Create the .conf files.
• Configure AWS to route traffic to your server (Route 53)
LAUNCHING• Launching a singular
instance.
• Have to manually make all
changes.
• Have nightmares if your
instance crashes.
• “Easy”* to learn.
• Puppet / Chef / Ansible
• Automatically make all
changes.
• Helps you to sleep in
peace.
• Weeks/months to learn.
* if you already know bash
IS THERE A HYBRID?
MEET CLOUDFORMATION.
github.com/
JosephMaxwell/
KCPUG-CloudFormation-Website
lamp-stack.swiftotter.com
CLOUDFORMATION• A JSON file
• Declarative instructions
• Configures the services mentioned in the overview
• Spins up as many instances as you wish
CLOUDFORMATION• No individual instance configuration.
• No persistence of state after deletion.
• Templates are updatable once loaded into Amazon.
FUNCTIONS• Ref
• Fn::Join
• Fn::Select
• Fn::GetAZs
• Fn::GetAtt
REF• Returns the reference to an object:
• http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html
FN::JOIN• Joins multiple strings together:
• http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-join.html
FN::SELECT• Gets a value from a list:
• http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.html
DEMO TIME
CONSIDERATIONS• DB access must be stored on each machine
• Session management
• Deployments
QUESTIONS?
GO FORTH!