SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Making Web Stack tasty using 
Cloudformation and some other 
ingredients.. 
..while watching pictures of food
Outline 
● Who am I? 
● Layered stacks 
● Cooking tools 
● Lesson learned 
● Q&A
Who am I?
May contain traces of JSON and Python
Cooking tools
Cloudformation 
● Describe resources in a template 
● Supports most AWS services 
● Infrastructure as code 
○ Reusable! 
Resources: 
http://goo.gl/IS68OZ and http://goo.gl/11iWau
Why Use It? 
● Controllable and predictable 
● Saves time 
● Dev, Staging, Prod 
● Modular
Anatomy of Cloudformation 
● Parameters - up to 60 nowadays 
● Mapping - Regional AMIs, NAT instances 
● Resources - Bulk of the template 
● Outputs - Endpoints, IDs for reference
10_vpc_layer.json 
● Params: CIDR, NAT AMI ID, NAT EIP, 
● Resources:VPC, Subnets, Security groups, 
NAT 
● Output: VPC ID, Subnet IDs
20_db_layer.json 
● Params: VPC IDs, Subnet ID for DB, DNS for 
DB, DB size, DB name, DB admin etc 
● Resources: RDS 
● Output: RDS endpoint
30_web_layer.json 
● Params: VPC IDs, Subnet ID for webserver, 
autoscaling min/max etc. 
● Resources: Autoscaling group, ELB, Ec2 
instances. 
● Output: ELB endpoint
"Resources" : { 
"MyEc2Instance" : { 
"Type" : "AWS::EC2::Instance", 
"Properties" : { 
"ImageId" : "ami-a921dfde", 
"KeyName" : "myec2key", 
"InstanceType" : "m1.small", 
"SecurityGroups" : [{ "Ref" : "Ec2SecurityGroup" }], 
} 
}, 
....
"Resources" : { 
"MyEc2Instance" : { 
"Type" : "AWS::EC2::Instance", 
"Properties" : { 
"ImageId" : { "Ref" : "ImageIdParam" }, 
"KeyName" :{ "Ref" : "KeyNameParm" }, 
"InstanceType" :{ "Ref" : "InstanceTypeParam" }, 
"SecurityGroups" : [{ "Ref" : "Ec2SecurityGroup" }], 
} 
}, 
.... 
Additional snippets: 
http://goo.gl/Gj0JI0
Troposphere 
Python Vs JSON 
Objects Vs Text 
Import Vs Copy/Paste 
Installation: 
sudo pip install troposphere --upgrade
From troposphere to 
cloudformation 
10_vpc.py 
20_web.py 
30_db.py 
10_vpc.json 
20_web.json 
30_db.json 
print template.to_json()
Example 
from troposphere import FindInMap, GetAtt, Join,Parameter, Output, Ref, 
Select, Tags, Template 
import troposphere.ec2 as ec2 
... 
ec2_instance = template.add_resource(ec2 .Instance( 
"MyEc2Instance" , 
ImageId =FindInMap( "RegionMap" , Ref("AWS::Region" ), "AMI"), 
InstanceType =Ref(instancetype_param), 
KeyName =Ref(keyname_param), 
SecurityGroups =Ref(ec2_sg), 
))
Gluing it together.. 
AWS Command line: 
unified tool to manage AWS 
resources, including 
Cloudformation 
Installation: 
sudo pip install awscli --upgrade 
Additional resources: 
http://goo.gl/PLkbfI
Gluing it together.. 
● Create cloudformation: 
○ python 10_vpc.py > 10_vpc.json; 
● Copy to S3: 
○ aws cp 10_vpc.json s3://bucket/10_vpc.json; 
● Instantiate template: 
○ aws cloudformation create-stack --stack-name 10-VPC -- 
template-url bucketurl --parameter vpc_params.json -- 
capabilities CAPABILITY_IAM
Lesson learned 
● Parameterize 
● Avoid layer dependency 
● Handle updates with care 
○ Resource protection
Questions??
Get in touch 
LinkedIn: https://www.linkedin.com/in/nicolasalvo 
Twitter: @cloudreach 
Website: www.cloudreach.com

Weitere ähnliche Inhalte

Was ist angesagt?

Operational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB WebinarOperational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB Webinar
MongoDB
 
Template of rds
Template of rdsTemplate of rds
Template of rds
Tao Tao
 
Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014
MongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
MongoDB
 

Was ist angesagt? (20)

Mysqlnd uh
Mysqlnd uhMysqlnd uh
Mysqlnd uh
 
Node.js 與 google cloud storage
Node.js 與 google cloud storageNode.js 與 google cloud storage
Node.js 與 google cloud storage
 
Operational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB WebinarOperational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB Webinar
 
Rails with MongoDB - RORLab 47th
Rails with MongoDB - RORLab 47th Rails with MongoDB - RORLab 47th
Rails with MongoDB - RORLab 47th
 
Elasticsearch 설치 및 기본 활용
Elasticsearch 설치 및 기본 활용Elasticsearch 설치 및 기본 활용
Elasticsearch 설치 및 기본 활용
 
Running Node Applications on iOS and Android
Running Node Applications on iOS and AndroidRunning Node Applications on iOS and Android
Running Node Applications on iOS and Android
 
MongoDB: How it Works
MongoDB: How it WorksMongoDB: How it Works
MongoDB: How it Works
 
MongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster TutorialMongoDB - Sharded Cluster Tutorial
MongoDB - Sharded Cluster Tutorial
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Curlin' for Docs
Curlin' for DocsCurlin' for Docs
Curlin' for Docs
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Template of rds
Template of rdsTemplate of rds
Template of rds
 
Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014Hadoop - MongoDB Webinar June 2014
Hadoop - MongoDB Webinar June 2014
 
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
MongoDB: Comparing WiredTiger In-Memory Engine to RedisMongoDB: Comparing WiredTiger In-Memory Engine to Redis
MongoDB: Comparing WiredTiger In-Memory Engine to Redis
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
Message Decrypt
Message DecryptMessage Decrypt
Message Decrypt
 
Webinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDBWebinar: Architecting Secure and Compliant Applications with MongoDB
Webinar: Architecting Secure and Compliant Applications with MongoDB
 
Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3
 

Ähnlich wie Making web stack tasty using Cloudformation

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
Fernando Rodriguez
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
維佋 唐
 

Ähnlich wie Making web stack tasty using Cloudformation (20)

CloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use casesCloudFormation vs. Elastic Beanstalk & Use cases
CloudFormation vs. Elastic Beanstalk & Use cases
 
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
 
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
 
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
 
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
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
 
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 Automating your Infrastructure Deployment with CloudFormation and OpsWorks –... Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 
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
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMR
 
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
 
Immutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS LambdaImmutable Deployments with AWS CloudFormation and AWS Lambda
Immutable Deployments with AWS CloudFormation and AWS Lambda
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
 
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
 
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)Manage cloud infrastructures using Zend Framework 2 (and ZF1)
Manage cloud infrastructures using Zend Framework 2 (and ZF1)
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Making web stack tasty using Cloudformation

  • 1. Making Web Stack tasty using Cloudformation and some other ingredients.. ..while watching pictures of food
  • 2. Outline ● Who am I? ● Layered stacks ● Cooking tools ● Lesson learned ● Q&A
  • 4. May contain traces of JSON and Python
  • 5.
  • 6.
  • 7.
  • 9. Cloudformation ● Describe resources in a template ● Supports most AWS services ● Infrastructure as code ○ Reusable! Resources: http://goo.gl/IS68OZ and http://goo.gl/11iWau
  • 10. Why Use It? ● Controllable and predictable ● Saves time ● Dev, Staging, Prod ● Modular
  • 11. Anatomy of Cloudformation ● Parameters - up to 60 nowadays ● Mapping - Regional AMIs, NAT instances ● Resources - Bulk of the template ● Outputs - Endpoints, IDs for reference
  • 12. 10_vpc_layer.json ● Params: CIDR, NAT AMI ID, NAT EIP, ● Resources:VPC, Subnets, Security groups, NAT ● Output: VPC ID, Subnet IDs
  • 13. 20_db_layer.json ● Params: VPC IDs, Subnet ID for DB, DNS for DB, DB size, DB name, DB admin etc ● Resources: RDS ● Output: RDS endpoint
  • 14. 30_web_layer.json ● Params: VPC IDs, Subnet ID for webserver, autoscaling min/max etc. ● Resources: Autoscaling group, ELB, Ec2 instances. ● Output: ELB endpoint
  • 15. "Resources" : { "MyEc2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "ImageId" : "ami-a921dfde", "KeyName" : "myec2key", "InstanceType" : "m1.small", "SecurityGroups" : [{ "Ref" : "Ec2SecurityGroup" }], } }, ....
  • 16. "Resources" : { "MyEc2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "ImageId" : { "Ref" : "ImageIdParam" }, "KeyName" :{ "Ref" : "KeyNameParm" }, "InstanceType" :{ "Ref" : "InstanceTypeParam" }, "SecurityGroups" : [{ "Ref" : "Ec2SecurityGroup" }], } }, .... Additional snippets: http://goo.gl/Gj0JI0
  • 17.
  • 18. Troposphere Python Vs JSON Objects Vs Text Import Vs Copy/Paste Installation: sudo pip install troposphere --upgrade
  • 19. From troposphere to cloudformation 10_vpc.py 20_web.py 30_db.py 10_vpc.json 20_web.json 30_db.json print template.to_json()
  • 20. Example from troposphere import FindInMap, GetAtt, Join,Parameter, Output, Ref, Select, Tags, Template import troposphere.ec2 as ec2 ... ec2_instance = template.add_resource(ec2 .Instance( "MyEc2Instance" , ImageId =FindInMap( "RegionMap" , Ref("AWS::Region" ), "AMI"), InstanceType =Ref(instancetype_param), KeyName =Ref(keyname_param), SecurityGroups =Ref(ec2_sg), ))
  • 21. Gluing it together.. AWS Command line: unified tool to manage AWS resources, including Cloudformation Installation: sudo pip install awscli --upgrade Additional resources: http://goo.gl/PLkbfI
  • 22. Gluing it together.. ● Create cloudformation: ○ python 10_vpc.py > 10_vpc.json; ● Copy to S3: ○ aws cp 10_vpc.json s3://bucket/10_vpc.json; ● Instantiate template: ○ aws cloudformation create-stack --stack-name 10-VPC -- template-url bucketurl --parameter vpc_params.json -- capabilities CAPABILITY_IAM
  • 23. Lesson learned ● Parameterize ● Avoid layer dependency ● Handle updates with care ○ Resource protection
  • 25. Get in touch LinkedIn: https://www.linkedin.com/in/nicolasalvo Twitter: @cloudreach Website: www.cloudreach.com