SlideShare a Scribd company logo
An introduction to AWS CloudFormation
Julien Simon
Principal Technical Evangelist
Amazon Web Services
julsimon@amazon.fr
@julsimon
AWS CloudFormation
•  Fundamental service in AWS used for automating
deployment and configuration of resources
•  CloudFormation Template
•  JSON-formatted document which describes a configuration to
be deployed in an AWS account
•  When deployed, refers to a “stack” of resources
•  Not a “script”, a document
AWS CloudFormation
Infrastructure as code
•  Versioned, auditable blueprints (developers can contribute)
•  Quick to deploy, repeatable, tested infrastructure
•  Enables CI/CD for infrastructure (just like everything else)
•  Deploy many times, anywhere
Typical use cases for AWS CloudFormation
•  Used internally by many AWS products (Elastic Beanstalk, ECS)
•  Replicating environments
•  Dev, staging, pre-production, production
•  Same architecture, different sizing à template + parameters
•  Deploying in a different region
•  Green / blue deployments
•  Disaster Recovery
Case study: Viadeo
https://www.youtube.com/watch?v=JJm4V5fd0Z8
CloudFormation Template Structure
Resources
Describe detailed configuration of
a resource in AWS
Include, but not limited to:
•  IAM Policies, Users, Groups,
Roles
•  VPCs, Subnets, NACLs, Security
Groups
•  EC2 instances, AutoScaling
Groups
•  RDS Databases, S3 Buckets
•  Elastic Load Balancers
•  CloudWatch Alarms
•  Lambda Functions
•  Logging (CloudTrail, CW Logs)
Nested Templates
•  CloudFormation stacks themselves can be resources
“AWS::CloudFormation::Stack”
•  Useful for making reusable templates, segmenting
resources, and avoiding template size limitations
•  Launching a template with nested stacks will launch
multiple sub-stacks
•  Deleting the launching stack will, by default, delete all
substacks
Parameters
•  Used to pass in variables
when launching a stack
•  Use the “Ref” function to
reference these variables
in the Resources section
of the template
Mappings
•  Provides a set of custom named-value pairs
•  Use for setting values based on different
possible conditions (most notably, regions)
•  Commonly used for mapping different AMI
IDs to make template reusable across
multiple AWS regions
•  Use the FindInMap function when
referencing in resources
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}
Conditions
•  Allow you to determine if a resource gets created or a
property is defined
•  The “Condition” attribute applied to any resource to
specify a condition defined in the “Conditions” section of
the template
•  Condition must evaluate to true, otherwise the resource
will not get created
"MountPoint" :
{
"Type" : "AWS::EC2::VolumeAttachment",
"Condition" : "CreateProdResources",
"Properties" : {
"InstanceId" : { "Ref" : "EC2Instance" },
"VolumeId" : { "Ref" : "NewVolume" },
"Device" : "/dev/sdh“
}
}
AWS CloudFormation best practices
•  Don’t start from scratch
•  Read sample templates
•  Use CloudFormer as a starting point (more info on the next slide)
•  Reuse as much as possible
•  Don’t go crazy on nested stacks… 1 level should be enough
•  Use parameters: environment, region, instance names, instance sizes, etc..
•  Tag everything with the stack name and version number
CloudFormer
https://aws.amazon.com/developertools/6460180344805680
A new EC2 instance running CloudFormer will be started.
Connect to it, let it describe all your resources
Select the ones that you want to see listed in the template
Let’s summon the clouds!
Create a CodeCommit repository
to version our stacks
Create, update, delete
a basic stack
Create a VPC with 4 subnets. Add
a public instance.
Create A LAMP stack
Using CloudFormer
Demo gods, I’m your humble servant, please be good to me
Create a Git repository with AWS CodeCommit
$ aws codecommit create-repository
--repository-name cfdemo --region us-east-1
--repository-description ”CloudFormation
demo"
$ git clone ssh://git-codecommit.us-
east-1.amazonaws.com/v1/repos/cfdemo
Managing AWS CloudFormation with the CLI
$ aws cloudformation validate-template --template-body
file://template.json
$ aws cloudformation create-stack --template-body file://
template.json --stack-name MyTemplate --region eu-west-1
$ aws cloudformation get-template --stack-name MyTemplate
$ aws cloudformation update-stack --stack-name MyTemplate
--template-body file://template.json
$ aws cloudformation delete-stack --stack-name MyTemplate
AWS CloudFormation resources
Documentation
https://aws.amazon.com/fr/documentation/cloudformation/
https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html
Blogs
https://aws.amazon.com/fr/blogs/aws/category/aws-cloud-formation/
https://blogs.aws.amazon.com/application-management/blog/tag/CloudFormation
Sessions @ AWS re:Invent 2015
ARC307 - Infrastructure as Code: slides and video
ARC401 - Cloud First: New Architecture for New Infrastructure: slides and video
DVO303 - Scaling Infrastructure Operations with AWS: slides and video
DVO304 - AWS CloudFormation Best Practices: slides and video
DVO310 - Benefit from DevOps When Moving to AWS for Windows: slides and video
DVO401 - Deep Dive into Blue/Green Deployments on AWS: slides and video
SEC312 - Reliable Design and Deployment of Security and Compliance: slides and video
Julien Simon
Principal Technical Evangelist, AWS
julsimon@amazon.fr
@julsimon

More Related Content

What's hot

CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
Amazon Web Services
 

What's hot (20)

Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
 
Deep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormationDeep Dive: AWS CloudFormation
Deep Dive: AWS CloudFormation
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
 
(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling(CMP201) All You Need To Know About Auto Scaling
(CMP201) All You Need To Know About Auto Scaling
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
 
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingCloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
 
AWS networking fundamentals
AWS networking fundamentalsAWS networking fundamentals
AWS networking fundamentals
 
Introduction to AWS Organizations
Introduction to AWS OrganizationsIntroduction to AWS Organizations
Introduction to AWS Organizations
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
 
Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
Aws Autoscaling
Aws AutoscalingAws Autoscaling
Aws Autoscaling
 
AWS Monitoring & Logging
AWS Monitoring & LoggingAWS Monitoring & Logging
AWS Monitoring & Logging
 
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
 
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
Amazon CloudWatch Tutorial | AWS Certification | Cloud Monitoring Tools | AWS...
 
Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 

Viewers also liked

(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
Amazon Web Services
 

Viewers also liked (20)

RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
RMG207 Introduction to AWS CloudFormation - AWS re: Invent 2012
 
Mastering the fundamentals of AWS billing 8-20-15
Mastering the fundamentals of AWS billing 8-20-15Mastering the fundamentals of AWS billing 8-20-15
Mastering the fundamentals of AWS billing 8-20-15
 
RMG205 Decoding Your AWS Bill - - AWS re: Invent 2012
RMG205 Decoding Your AWS Bill - - AWS re: Invent 2012RMG205 Decoding Your AWS Bill - - AWS re: Invent 2012
RMG205 Decoding Your AWS Bill - - AWS re: Invent 2012
 
(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
(ARC302) Running Lean Architectures: How to Optimize for Cost Efficiency | AW...
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
(ARC304) Designing for SaaS: Next-Generation Software Delivery Models on AWS ...
(ARC304) Designing for SaaS: Next-Generation Software Delivery Models on AWS ...(ARC304) Designing for SaaS: Next-Generation Software Delivery Models on AWS ...
(ARC304) Designing for SaaS: Next-Generation Software Delivery Models on AWS ...
 
A brief introduction to CloudFormation
A brief introduction to CloudFormationA brief introduction to CloudFormation
A brief introduction to CloudFormation
 
Infrastructure as Code with AWS CloudFormation
Infrastructure as Code with AWS CloudFormationInfrastructure as Code with AWS CloudFormation
Infrastructure as Code with AWS CloudFormation
 
How to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWSHow to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWS
 
AWS re:Invent 2016: Metering Big Data at AWS: From 0 to 100 Million Records i...
AWS re:Invent 2016: Metering Big Data at AWS: From 0 to 100 Million Records i...AWS re:Invent 2016: Metering Big Data at AWS: From 0 to 100 Million Records i...
AWS re:Invent 2016: Metering Big Data at AWS: From 0 to 100 Million Records i...
 
AWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS FailoverAWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS Failover
 
Event-Driven Serverless Apps - Pop-up Loft Tel Aviv
Event-Driven Serverless Apps - Pop-up Loft Tel AvivEvent-Driven Serverless Apps - Pop-up Loft Tel Aviv
Event-Driven Serverless Apps - Pop-up Loft Tel Aviv
 
Next Generation Open Data Platforms | AWS Public Sector Summit 2016
Next Generation Open Data Platforms | AWS Public Sector Summit 2016Next Generation Open Data Platforms | AWS Public Sector Summit 2016
Next Generation Open Data Platforms | AWS Public Sector Summit 2016
 
Ingest and storage options
Ingest and storage optionsIngest and storage options
Ingest and storage options
 
Movidiam
MovidiamMovidiam
Movidiam
 
Using amazon machine learning to identify trends in io t data technical 201
Using amazon machine learning to identify trends in io t data   technical 201Using amazon machine learning to identify trends in io t data   technical 201
Using amazon machine learning to identify trends in io t data technical 201
 
Sundog Media Toolkit
Sundog Media Toolkit Sundog Media Toolkit
Sundog Media Toolkit
 
Women in Technology: Supporting Diversity in a Technical Workplace
Women in Technology: Supporting Diversity in a Technical WorkplaceWomen in Technology: Supporting Diversity in a Technical Workplace
Women in Technology: Supporting Diversity in a Technical Workplace
 
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesosDevOps en Amazon: Un vistazo a nuestras herramientas y procesos
DevOps en Amazon: Un vistazo a nuestras herramientas y procesos
 
AWS Mobile Hub
AWS Mobile HubAWS Mobile Hub
AWS Mobile Hub
 

Similar to An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv

Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Amazon Web Services
 

Similar to An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv (20)

AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)AWS CloudFormation (February 2016)
AWS CloudFormation (February 2016)
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
Dev & Test on AWS - Hebrew Webinar
Dev & Test on AWS - Hebrew WebinarDev & Test on AWS - Hebrew Webinar
Dev & Test on AWS - Hebrew Webinar
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office Hours
 
Cloud Formation
Cloud FormationCloud Formation
Cloud Formation
 
Dev & Test on AWS Webinar October 2017 - IL Webinar
Dev & Test on AWS Webinar October 2017 - IL WebinarDev & Test on AWS Webinar October 2017 - IL Webinar
Dev & Test on AWS Webinar October 2017 - IL Webinar
 
(DVO304) AWS CloudFormation Best Practices
(DVO304) AWS CloudFormation Best Practices(DVO304) AWS CloudFormation Best Practices
(DVO304) AWS CloudFormation Best Practices
 
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as CodeAWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
 
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
AWS CloudFormation: Infrastructure as Code | AWS Public Sector Summit 2016
 
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
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
saa3_wk5.pdf
saa3_wk5.pdfsaa3_wk5.pdf
saa3_wk5.pdf
 
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot InstancesWKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
WKS401 Deploy a Deep Learning Framework on Amazon ECS and EC2 Spot Instances
 
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...
 
Infrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web ServicesInfrastructure as code with Amazon Web Services
Infrastructure as code with Amazon Web Services
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot InstancesWorkshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
Workshop; Deploy a Deep Learning Framework on Amazon ECS and Spot Instances
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Recently uploaded (20)

IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 

An introduction to AWS CloudFormation - Pop-up Loft Tel Aviv

  • 1. An introduction to AWS CloudFormation Julien Simon Principal Technical Evangelist Amazon Web Services julsimon@amazon.fr @julsimon
  • 2. AWS CloudFormation •  Fundamental service in AWS used for automating deployment and configuration of resources •  CloudFormation Template •  JSON-formatted document which describes a configuration to be deployed in an AWS account •  When deployed, refers to a “stack” of resources •  Not a “script”, a document
  • 4.
  • 5. Infrastructure as code •  Versioned, auditable blueprints (developers can contribute) •  Quick to deploy, repeatable, tested infrastructure •  Enables CI/CD for infrastructure (just like everything else) •  Deploy many times, anywhere
  • 6. Typical use cases for AWS CloudFormation •  Used internally by many AWS products (Elastic Beanstalk, ECS) •  Replicating environments •  Dev, staging, pre-production, production •  Same architecture, different sizing à template + parameters •  Deploying in a different region •  Green / blue deployments •  Disaster Recovery
  • 9. Resources Describe detailed configuration of a resource in AWS Include, but not limited to: •  IAM Policies, Users, Groups, Roles •  VPCs, Subnets, NACLs, Security Groups •  EC2 instances, AutoScaling Groups •  RDS Databases, S3 Buckets •  Elastic Load Balancers •  CloudWatch Alarms •  Lambda Functions •  Logging (CloudTrail, CW Logs)
  • 10. Nested Templates •  CloudFormation stacks themselves can be resources “AWS::CloudFormation::Stack” •  Useful for making reusable templates, segmenting resources, and avoiding template size limitations •  Launching a template with nested stacks will launch multiple sub-stacks •  Deleting the launching stack will, by default, delete all substacks
  • 11. Parameters •  Used to pass in variables when launching a stack •  Use the “Ref” function to reference these variables in the Resources section of the template
  • 12. Mappings •  Provides a set of custom named-value pairs •  Use for setting values based on different possible conditions (most notably, regions) •  Commonly used for mapping different AMI IDs to make template reusable across multiple AWS regions •  Use the FindInMap function when referencing in resources "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}
  • 13. Conditions •  Allow you to determine if a resource gets created or a property is defined •  The “Condition” attribute applied to any resource to specify a condition defined in the “Conditions” section of the template •  Condition must evaluate to true, otherwise the resource will not get created "MountPoint" : { "Type" : "AWS::EC2::VolumeAttachment", "Condition" : "CreateProdResources", "Properties" : { "InstanceId" : { "Ref" : "EC2Instance" }, "VolumeId" : { "Ref" : "NewVolume" }, "Device" : "/dev/sdh“ } }
  • 14. AWS CloudFormation best practices •  Don’t start from scratch •  Read sample templates •  Use CloudFormer as a starting point (more info on the next slide) •  Reuse as much as possible •  Don’t go crazy on nested stacks… 1 level should be enough •  Use parameters: environment, region, instance names, instance sizes, etc.. •  Tag everything with the stack name and version number
  • 15. CloudFormer https://aws.amazon.com/developertools/6460180344805680 A new EC2 instance running CloudFormer will be started. Connect to it, let it describe all your resources Select the ones that you want to see listed in the template
  • 16. Let’s summon the clouds! Create a CodeCommit repository to version our stacks Create, update, delete a basic stack Create a VPC with 4 subnets. Add a public instance. Create A LAMP stack Using CloudFormer Demo gods, I’m your humble servant, please be good to me
  • 17. Create a Git repository with AWS CodeCommit $ aws codecommit create-repository --repository-name cfdemo --region us-east-1 --repository-description ”CloudFormation demo" $ git clone ssh://git-codecommit.us- east-1.amazonaws.com/v1/repos/cfdemo
  • 18. Managing AWS CloudFormation with the CLI $ aws cloudformation validate-template --template-body file://template.json $ aws cloudformation create-stack --template-body file:// template.json --stack-name MyTemplate --region eu-west-1 $ aws cloudformation get-template --stack-name MyTemplate $ aws cloudformation update-stack --stack-name MyTemplate --template-body file://template.json $ aws cloudformation delete-stack --stack-name MyTemplate
  • 19. AWS CloudFormation resources Documentation https://aws.amazon.com/fr/documentation/cloudformation/ https://docs.aws.amazon.com/fr_fr/AWSCloudFormation/latest/UserGuide/cfn-sample-templates.html Blogs https://aws.amazon.com/fr/blogs/aws/category/aws-cloud-formation/ https://blogs.aws.amazon.com/application-management/blog/tag/CloudFormation Sessions @ AWS re:Invent 2015 ARC307 - Infrastructure as Code: slides and video ARC401 - Cloud First: New Architecture for New Infrastructure: slides and video DVO303 - Scaling Infrastructure Operations with AWS: slides and video DVO304 - AWS CloudFormation Best Practices: slides and video DVO310 - Benefit from DevOps When Moving to AWS for Windows: slides and video DVO401 - Deep Dive into Blue/Green Deployments on AWS: slides and video SEC312 - Reliable Design and Deployment of Security and Compliance: slides and video
  • 20. Julien Simon Principal Technical Evangelist, AWS julsimon@amazon.fr @julsimon