Your SlideShare is downloading. ×
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

ARC204 AWS Infrastructure Automation - AWS re: Invent 2012

2,376
views

Published on

So, you’ve got your solution deployed and have so many things to manage…now what? Come to this session to learn how you can scale operations with solutions deployed in the AWS cloud. We take a look at …

So, you’ve got your solution deployed and have so many things to manage…now what? Come to this session to learn how you can scale operations with solutions deployed in the AWS cloud. We take a look at services like AWS CloudFormation and tools like Chef and Puppet. See an overview of these services and tools, and we show you how they might be used in real-life scenarios and how you might incorporate these services and tools into your own environment.


0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,376
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
8
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Anatomy of a template
  • 2. { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example uses the default security group, so toSSH to the new instance using the KeyPair you enter, you will need to have port 22 open in your default security group. **WARNING** This template an Amazon EC2 instances. 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 instance", "Type" : "String" } }, "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-7f418316" }, "us-west-1" : { "AMI" : "ami-951945d0" }, "us-west-2" : { "AMI" : "ami-16fd7026" }, "eu-west-1" : { "AMI" : "ami-24506250" }, "sa-east-1" : { "AMI" : "ami-3e3be423" }, "ap-southeast-1" : { "AMI" : "ami-74dda626" }, "ap-northeast-1" : { "AMI" : "ami-dcfa4edd" } } }, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }, "Outputs" : { "InstanceId" : { "Description" : "InstanceId of the newly created EC2 instance", "Value" : { "Ref" : "Ec2Instance" } }, "AZ" : { "Description" : "Availability Zone of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } }, "PublicDNS" : { "Description" : "Public DNSName of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicDnsName" ] } } }}
  • 3. "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example uses the default security group, so toSSH to the new instance using the KeyPair you enter, you will need to have port 22 open in your default security group. **WARNING** This template an Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.", "Parameters" : { HEADERS "KeyName" : { } "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" PARAMETERS }, "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-7f418316" }, "us-west-1" : { "AMI" : "ami-951945d0" }, "us-west-2" : { "AMI" : "ami-16fd7026" }, "eu-west-1" "sa-east-1" : { "AMI" : "ami-24506250" }, : { "AMI" : "ami-3e3be423" }, "ap-southeast-1" : { "AMI" : "ami-74dda626" }, "ap-northeast-1" : { "AMI" : "ami-dcfa4edd" } MAPPINGS } }, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { } "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "UserData" : { "Fn::Base64" : "80" } RESOURCES } }, "Outputs" : { "InstanceId" : { "Description" : "InstanceId of the newly created EC2 instance", "Value" : { "Ref" : "Ec2Instance" } }, "AZ" : { }, "Description" : "Availability Zone of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } "PublicDNS" : { OUTPUTS "Description" : "Public DNSName of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicDnsName" ] } } }}
  • 4. Parameters:
  • 5. Mappings:
  • 6. Resources – EC2:
  • 7. Resources – Streaming Media Server:
  • 8. Resources – CloudFront Distribution:
  • 9. Outputs:
  • 10. Resources – RDS:
  • 11. Resources – Security Groups:
  • 12. Resources – VPC:
  • 13. Use AWS::CloudFormation::Init with cfn-init to help bootstrap instances:
  • 14. Install packages with the native package management tool:
  • 15. That sounds a lot likeCloudFormation?
  • 16. Together, a great solution
  • 17. CloudFormation: Chef / Puppet:
  • 18. So what does workingwith this all look like?
  • 19. automatically setting up yourservers Install latest software  Copy data  Open port 80 Register with DNS  Update packages  Mount devices Start services  Reboot
  • 20. automatically setting upyour servers
  • 21. automatically setting upyour servers
  • 22. Fully Functional AMI OS-Only AMI Partially Configured AMI
  • 23. CloudFormation - Install Packages needed to run Chef:
  • 24. CloudFormation – Configure files needed to runChef:
  • 25. CloudFormation – Configure node role:
  • 26. CloudFormation – Have UserData run Chef at start: "Properties”:…"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [ "#!/bin/bash -vn", "function error_exitn", "{n", " cfn-signal -e 1 -r "$1" ", { "Ref" : "ChefClientWaitHandle" }, "n", " exit 1n", "}n", "chef-client -j /etc/chef/first_run.json > /tmp/initialize_client.log 2>&1 || error_exit Failed to initialize host via chef clientn" "# If all went well, signal successn", "cfn-signal -e $? -r Chef Client configuration ", { "Ref" : "ChefClientWaitHandle" }, "n" ]]}},
  • 27. We are sincerely eager tohear your FEEDBACK on thispresentation and on re:Invent. Please fill out an evaluation form when you have a chance.