Amazon Elastic Compute Cloud (Amazon EC2) provides resizable compute capacity in the cloud and is often the starting point for your first week using AWS. This session will introduce these concepts, along with the fundamentals of EC2, by employing an agile approach that is made possible by the cloud. Attendees will experience the reality of what a first week on EC2 looks like from the perspective of someone deploying an actual application on EC2. You will follow them as they progress from deploying their entire application from an EC2 AMI on day 1 to more advanced features and patterns available in EC2 by day 5. Throughout the process we will identify cloud best practices that can be applied to your first week on EC2 and beyond.
2. things you should know/think about up front
some best practices for getting started
essential technologies to dive into and get familiar with
architectural principles you should immerse yourself in
What are we going to cover?
Your first 5 days with EC2…
3. hear a ‘looking back at our first year’ customer story
compressed into 5 days
What are we going to cover?
Your first 5 days with EC2…
5. Users & Roles
Start as you mean to go on
Secure your console with IAM
roles
A little time spent now will save
headaches later
6. Users & Roles
Start as you mean to go on
Secure your console with IAM
roles
A little time spent now will save
headaches later
Accounts & Billing
Create a structure that makes sense
Dev & Test accounts vs production
Consolidated billing
Resource tagging
16. Secrets & Keys
Your front door keys
Control access to
your instances
Key management
strategy
17. Secrets & Keys
Control access to
your APIs
Your front door keys
Use IAM Roles to
distribute to instances
Control access to
your instances
Key management
strategy
38. Bake an AMI
Start an instance
Configure the
instance
Create an AMI from
your instance
Start new ones from
the AMI
Bootstrapping
39. Bake an AMI
Start an instance
Configure the
instance
Create an AMI from
your instance
Start new ones from
the AMI
Bootstrapping
ec2-run-instances
<your ami-id>
$>
40. Bake an AMI Configure dynamically
Start an instance
Configure the
instance
Create an AMI from
your instance
Start new ones from
the AMI
Bootstrapping
Launch an instance
Use metadata service
and cloud-init to
perform actions on
instance when it
launches
vs
Bootstrapping
41. Bake an AMI
Build your base
images and setup
custom initialisation
scripts
Maintain your ‘golden’
base
Bootstrapping
Use bootstrapping to
pass custom
information in and
perform post launch
tasks like pulling
code from SVN
+
Bootstrapping
Configure dynamically
42. Bake an AMI
Bootstrapping
Time consuming configuration
(e.g startup time)
Static configurations
(e.g less change management)
Bootstrapping
Configure dynamically
48. #!/bin/sh
yum -y install httpd php mysql php-mysql
chkconfig httpd on
/etc/init.d/httpd start
Shell script in user-data will be executed on launch:
49. Amazon Windows EC2Config Service executes user-
data on launch:
<script>dir > c:test.log</script>
<powershell>any command that you can run</powershell>
<powershell>
Read-S3Object -BucketName myS3Bucket
-Key myFolder/myFile.zip
-File c:destinationFile.zip
</powershell>
AWS Powershell Tools
50. Why do this?
Automation
Less fingers, less mistakes
Availability
Drive higher
availability with
self-healing
Security
Instances
locked down by
default
Flexible
Shell,
Powershell,
CloudFormation
,Chef, Puppet,
OpsWorks
Scale
Manage large scale
deployments and drive
autoscaling
Efficiency
Audit and manage
your estate with
less time & effort
55. A bit of S3 code
(pulled down automatically from S3)
>>> from boto.s3.key import Key
>>> k = Key(bucket)
>>> k.key = 'foobar'
>>> k.set_contents_from_string('This is a test of S3')
My little instance
(created programmatically)
56. A bit of S3 code
(installed automatically)
>>> from boto.s3.key import Key
>>> k = Key(bucket)
>>> k.key = 'foobar'
>>> k.set_contents_from_string('This is a test of S3')
My little instance
(created programmatically)
UNLIMITED storage
from my little instance
58. Services instead of software
Removes undifferentiated heavy lifting
S3 for object storage
SQS for queues
RDS for databases
CloudWatch for monitoring
65. Find out more about model architectures in:
Building Web Scale Applications session
66. Get set up right from the start
Understand programmable compute
Use the tools and have a play
Explore the services beyond EC2
Build something! (you can always throw it away)
Summary
Lessons learned…
aws.typepad.com