Anatomy of a template
{    "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Cre...
"AWSTemplateFormatVersion" : "2010-09-09", "Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create a...
Parameters:
Mappings:
Resources – EC2:
Resources – Streaming Media Server:
Resources – CloudFront Distribution:
Outputs:
Resources – RDS:
Resources – Security Groups:
Resources – VPC:
Use AWS::CloudFormation::Init with cfn-init to help bootstrap instances:
Install packages with the native package management tool:
That sounds a lot likeCloudFormation?
Together, a great solution
CloudFormation:   Chef / Puppet:
So what does workingwith this all look like?
automatically setting up yourservers Install latest software    Copy data          Open port 80 Register with DNS     ...
automatically setting upyour servers
automatically setting upyour servers
Fully Functional AMI                          OS-Only AMI                       Partially Configured                      ...
CloudFormation - Install Packages needed to run Chef:
CloudFormation – Configure files needed to runChef:
CloudFormation – Configure node role:
CloudFormation – Have UserData run Chef at start: "Properties”:…"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [   "#!/...
We are sincerely eager tohear your FEEDBACK on thispresentation and on re:Invent. Please fill out an evaluation   form whe...
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
ARC204 AWS Infrastructure Automation - AWS re: Invent 2012
Upcoming SlideShare
Loading in...5
×

ARC204 AWS Infrastructure Automation - AWS re: Invent 2012

2,560

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 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.

ARC204 AWS Infrastructure Automation - AWS re: Invent 2012

  1. 1. Anatomy of a template
  2. 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. 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. 4. Parameters:
  5. 5. Mappings:
  6. 6. Resources – EC2:
  7. 7. Resources – Streaming Media Server:
  8. 8. Resources – CloudFront Distribution:
  9. 9. Outputs:
  10. 10. Resources – RDS:
  11. 11. Resources – Security Groups:
  12. 12. Resources – VPC:
  13. 13. Use AWS::CloudFormation::Init with cfn-init to help bootstrap instances:
  14. 14. Install packages with the native package management tool:
  15. 15. That sounds a lot likeCloudFormation?
  16. 16. Together, a great solution
  17. 17. CloudFormation: Chef / Puppet:
  18. 18. So what does workingwith this all look like?
  19. 19. automatically setting up yourservers Install latest software  Copy data  Open port 80 Register with DNS  Update packages  Mount devices Start services  Reboot
  20. 20. automatically setting upyour servers
  21. 21. automatically setting upyour servers
  22. 22. Fully Functional AMI OS-Only AMI Partially Configured AMI
  23. 23. CloudFormation - Install Packages needed to run Chef:
  24. 24. CloudFormation – Configure files needed to runChef:
  25. 25. CloudFormation – Configure node role:
  26. 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. 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.

×