SlideShare a Scribd company logo
1 of 32
Download to read offline
Mastering
AWS CloudFormation
Michael Blum, Senior Devops-Engineer
DevOps Guild - 31. August 2023
1. Introduction
2. Standards
3. Modularity & Reusability
4. Sharing Stack information
5. Policy Based Resources
6. Updatable Resources
7. End2End testing
8. Demo
9. General recommendations
Mastering
AWS CloudFormation
© 2020 Shine Solutions Group
AWS CloudFormation
Introduction
• Infrastructure as Code since 2011
• Serverless Application Model (SAM)
• Cloud Development Kit (CDK)
• HashiCorp Terraform
AWS CloudFormation
© 2020 Shine Solutions Group
4
Introduction
AWS CloudFormation
Standards
• Integrate Linters into Development Lifecycle
• cfn-lint
• cfn_nag
• statelint (Step Functions)
• Automate validation
• Pull Requests
• CI/CD
• Git Hook
AWS CloudFormation
© 2020 Shine Solutions Group
6
Standards - Linting
• Structuring CF Template
• Group by Service
• Group by Resource Type
• YAML Inline Comments
• Enhanced Readability
• Faster navigation
AWS CloudFormation
© 2020 Shine Solutions Group
7
Standards - Structuring
• Seperate by logical utilisation
• functional purpose
• operational purpose
• Modular design
• Simplified Updates
• Modular flexibility
• Isolated changes
AWS CloudFormation
© 2020 Shine Solutions Group
8
Standards - Separating
AWS CloudFormation
Modularity & Reusability
• Promotes Modularity
• Reduced deployment time
• Cost optimisation
• Reusability
• Increased flexibility
• Permission-Based Segregation
AWS CloudFormation
© 2020 Shine Solutions Group
10
Modularity & Reusability - Prerequisite Stack
AWS CloudFormation
© 2020 Shine Solutions Group
11
Modularity & Reusability - Prerequisite Stack
AWS CloudFormation
© 2020 Shine Solutions Group
12
Modularity & Reusability - Nested Stack
• Stacks within Stacks
• Modularisation
• Standardisation
• Reusable templates
• Dependency Management
• Output Reference
AWS CloudFormation
© 2020 Shine Solutions Group
13
Modularity & Reusability - Nested Stack
AWS CloudFormation
Sharing stack information
AWS CloudFormation
© 2020 Shine Solutions Group
15
Sharing - Export/Import
• Stack Outputs
• Unique per Account & Region
• Include stack name & environment name
• Parameterise as much as possible
• Imported outputs Cannot be deleted
• Preserve exported outputs
• Create new version of export
• Avoid for Single Stack version
AWS CloudFormation
© 2020 Shine Solutions Group
16
Sharing - Export/Import
AWS CloudFormation
© 2020 Shine Solutions Group
17
Sharing - Export/Import
AWS CloudFormation
© 2020 Shine Solutions Group
18
• Unique per Account & Region
• Include stack name & environment name
• Parameterise as much as possible
• Referred Parameters can be deleted
• Stack Update fails if deleted
• Creation, Deletion, Update
• Renaming == deletion
• Stack Update resolves updated parameter value
• Prefer for Single Stack version
Sharing - SSM
AWS CloudFormation
© 2020 Shine Solutions Group
19
Sharing - SSM
AWS CloudFormation
© 2020 Shine Solutions Group
20
Sharing - SSM
AWS CloudFormation
Policy Based Resources
• Detaching policy from resource
• Enhances Modularity
• Enhances Parameterisation
AWS CloudFormation
© 2020 Shine Solutions Group
22
Policy Based resources
AWS CloudFormation
© 2020 Shine Solutions Group
23
Policy Based resources
AWS CloudFormation
Updatable Resources
• Avoid Naming Resources
• Renaming = Replacing
• Prefer Tagging
• Lambda & Step Function incl. dynamic reference in S3Key
AWS CloudFormation
© 2020 Shine Solutions Group
25
Updatable Resources
AWS CloudFormation
End 2 End Testing
• TaskCat
• > taskcat test run
• Automated linting
• Automated Deployment
• Multiple Regions
• Test Result
AWS CloudFormation
© 2020 Shine Solutions Group
27
End 2 End Testing
AWS CloudFormation
© 2020 Shine Solutions Group
28
End 2 End Testing
AWS CloudFormation
DEMO
AWS CloudFormation
General recommendations
• Automate validation
• Keep a modular mindset
• Keep templates small
• Design templates enabling deployment of multiple stack versions
• Parameterise as much as possible
• Don’t hardcode information
• No manual changes to resources
• Include Policy-Based resources
• Ensure your resources are updatable
• If suitable automate testing
AWS CloudFormation
© 2020 Shine Solutions Group
31
General recommendations
Michael Blum
Senior Devops-Engineer
michael.blum@shinesolutions.com
linkedin.com/in/imblum
Michael Blum
mbloch1986
github.com/mbloch1986/cloudformation-samples

More Related Content

Similar to Michael_Blum_Mastering_CloudFormation.pdf

Cloud development professional_training_module_1603813251908
Cloud development professional_training_module_1603813251908Cloud development professional_training_module_1603813251908
Cloud development professional_training_module_1603813251908
prasennabhai
 

Similar to Michael_Blum_Mastering_CloudFormation.pdf (20)

Being Well-Architected in the Cloud
Being Well-Architected in the CloudBeing Well-Architected in the Cloud
Being Well-Architected in the Cloud
 
Migrating Your Windows Datacenter to AWS
Migrating Your Windows Datacenter to AWSMigrating Your Windows Datacenter to AWS
Migrating Your Windows Datacenter to AWS
 
Enterprise Cloud Architecture Best Practices
Enterprise Cloud Architecture Best PracticesEnterprise Cloud Architecture Best Practices
Enterprise Cloud Architecture Best Practices
 
Cloud Migration and Portability Best Practices
Cloud Migration and Portability Best PracticesCloud Migration and Portability Best Practices
Cloud Migration and Portability Best Practices
 
C* Summit 2013: Cassandra on Cloud Foundry by Renat Khasanshyn and Cornelia D...
C* Summit 2013: Cassandra on Cloud Foundry by Renat Khasanshyn and Cornelia D...C* Summit 2013: Cassandra on Cloud Foundry by Renat Khasanshyn and Cornelia D...
C* Summit 2013: Cassandra on Cloud Foundry by Renat Khasanshyn and Cornelia D...
 
AWS Public Sector Symposium 2014 Canberra | Test and Development on AWS
AWS Public Sector Symposium 2014 Canberra | Test and Development on AWSAWS Public Sector Symposium 2014 Canberra | Test and Development on AWS
AWS Public Sector Symposium 2014 Canberra | Test and Development on AWS
 
Azure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to KnowAzure vs AWS Best Practices: What You Need to Know
Azure vs AWS Best Practices: What You Need to Know
 
How to Optimize your DevOps Environment in the Cloud
How to Optimize your DevOps Environment in the CloudHow to Optimize your DevOps Environment in the Cloud
How to Optimize your DevOps Environment in the Cloud
 
Nested Beanstalk Deployment - Brett Sutter, Minneapolis
 Nested Beanstalk Deployment - Brett Sutter, Minneapolis Nested Beanstalk Deployment - Brett Sutter, Minneapolis
Nested Beanstalk Deployment - Brett Sutter, Minneapolis
 
re:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloudre:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloud
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
 
Cloud development professional_training_module_1603813251908
Cloud development professional_training_module_1603813251908Cloud development professional_training_module_1603813251908
Cloud development professional_training_module_1603813251908
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
 
Building Scalable Web Applications using Microservices Architecture and Serve...
Building Scalable Web Applications using Microservices Architecture and Serve...Building Scalable Web Applications using Microservices Architecture and Serve...
Building Scalable Web Applications using Microservices Architecture and Serve...
 
Running Business Critical Workloads on AWS – Nam Je Cho
Running Business Critical Workloads on AWS – Nam Je ChoRunning Business Critical Workloads on AWS – Nam Je Cho
Running Business Critical Workloads on AWS – Nam Je Cho
 
Ready.Set.Cloud - Enterprise Cloud Migration Framework
Ready.Set.Cloud - Enterprise Cloud Migration FrameworkReady.Set.Cloud - Enterprise Cloud Migration Framework
Ready.Set.Cloud - Enterprise Cloud Migration Framework
 
Azure Stack Fundamentals
Azure Stack FundamentalsAzure Stack Fundamentals
Azure Stack Fundamentals
 
Harness the Power of Infrastructure as Code
Harness the Power of Infrastructure as CodeHarness the Power of Infrastructure as Code
Harness the Power of Infrastructure as Code
 
Building Hybrid Cloud Apps with Azure and Azure stack
Building Hybrid Cloud Apps with Azure and Azure stackBuilding Hybrid Cloud Apps with Azure and Azure stack
Building Hybrid Cloud Apps with Azure and Azure stack
 
Being Well Architected in the Cloud
Being Well Architected in the CloudBeing Well Architected in the Cloud
Being Well Architected in the Cloud
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 

Michael_Blum_Mastering_CloudFormation.pdf