test infrastructure as code? - markwarneke.me · infrastructure as code is an approach to...
TRANSCRIPT
![Page 1: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/1.jpg)
Platinum Sponsor
![Page 2: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/2.jpg)
After this Session…
I am able to create a test-suite for an Infrastructure as Code project from scratch.
I can articulate why Infrastructure as Code testing is necessaryand increases the quality and reliability of provisioned services.
I have the ability to create an Infrastructure as Code projectfrom scratch, quicker and much more mature.
@MarkWarneke
![Page 3: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/3.jpg)
Agenda
• Introduction to Infrastructre as Code
• DevOps foundations
• Quality & Maturity Framework
• Running Test Code (Hopefully)
@MarkWarneke
![Page 4: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/4.jpg)
@MarkWarneke
– Kief Morris
Infrastructure as code is an approach to infrastructure automation based
on practices from software development.
It emphasizes consistent, repeatable routines for provisioning and changing systems and their
configuration.
Infrastructure as Code Kief Morris 9781491924358
![Page 5: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/5.jpg)
AppDev – InfraDev
@MarkWarneke
Application Development Infrastructure Development
![Page 6: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/6.jpg)
IaaS - SaaS
@MarkWarneke
Servers Services
![Page 7: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/7.jpg)
Outside – Inside View
@MarkWarneke
Hardware Configuration
• VM Size, Disks, Network
• RBAC, secrets etc.
Outside
Software
• Desired state
• Extensions & scripts
→ @IrwinStrachan
→@devblackops (Brandon Olin)
Inside
![Page 8: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/8.jpg)
Approaches
@MarkWarneke
![Page 9: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/9.jpg)
@MarkWarneke
– Bill Baker
treat your servers
like cattle, not pets
![Page 10: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/10.jpg)
Problem Statement
Static Configuration
(Yaml, JSON etc.)
no behaviorbut state
Validation ofrequirements
@MarkWarneke
![Page 11: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/11.jpg)
DevOps = People + Process + Tools
@MarkWarneke
2 Process
![Page 12: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/12.jpg)
@MarkWarneke
Value
Measure
Infrastructure as CodeDEV
STAGE
PROD
Code
![Page 13: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/13.jpg)
Build
Test
Source
Continuous Integration
@MarkWarneke
Value
Measure
cspkg
![Page 14: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/14.jpg)
QA EnvironmentArtifacts
Continuous Deployment
@MarkWarneke
Value
Measure
cspkgcspkg
![Page 15: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/15.jpg)
Quality & Maturity
Quality
Maturity
Best Practices, Linting, Code Generator
Unit Test, Static Analysis
Integration, End-to-End Testing
Pull-Request, Review
System Testing, Monitoring
@MarkWarneke
![Page 16: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/16.jpg)
@MarkWarneke
https://twitter.com/iamdevloper/status/397664295875805184?lang=en
![Page 17: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/17.jpg)
@MarkWarneke
aka.ms/az.new
aka.ms/az.new/resources
![Page 18: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/18.jpg)
VSCode Extensions & Liniting
@MarkWarneke
![Page 19: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/19.jpg)
![Page 20: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/20.jpg)
![Page 21: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/21.jpg)
![Page 22: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/22.jpg)
![Page 23: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/23.jpg)
![Page 24: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/24.jpg)
WhatIf
![Page 25: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/25.jpg)
![Page 26: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/26.jpg)
Integration
![Page 27: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/27.jpg)
![Page 28: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/28.jpg)
![Page 29: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/29.jpg)
![Page 30: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/30.jpg)
Azure DevOps
![Page 31: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/31.jpg)
https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema
Azure DevOps YAML
![Page 32: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/32.jpg)
![Page 33: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/33.jpg)
![Page 34: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/34.jpg)
![Page 35: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/35.jpg)
Summary
• What is infrastructure as code
• DevOps foundation
• Script Analyzer & Help Checker
• Static Analysis of configuration file
• Unit Test of IaC deployment
• Unit Test of pipeline
• Integration / System Test with Pester
@MarkWarneke
![Page 36: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/36.jpg)
Use the conference app to vote for this session:
https://my.eventraft.com/psconfeu
@MarkWarneke
![Page 37: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/37.jpg)
Maturity Model
@MarkWarnekeJez Humble, David Farley: Continuous Delivery Reliable
![Page 38: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/38.jpg)
Testing, Testing, 1...2...3: Using Pester forInfrastructure Validation by Brandon Olin
@MarkWarneke
• https://www.youtube.com/watch?v=6bPByJX5euc
• https://www.youtube.com/watch?v=Qfi_H7IZyHg
Infrastructure validation using Pester, byIrwin Strachan
![Page 39: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/39.jpg)
@MarkWarneke
http://download.microsoft.com/download/8/E/1/8E1DBEFA
-CECE-4DC9-A813-
93520A5D7CFE/World%20Class%20ARM%20Templates%20
-%20Considerations%20and%20Proven%20Practices.pdf
![Page 40: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/40.jpg)
Best Practices Guide
@MarkWarneke
• https://github.com/Azure/azure-quickstart-templates
• https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/best-practices.md
![Page 41: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/41.jpg)
Best Practices Guide
@MarkWarneke
• https://blogs.msdn.microsoft.com/mvpawardprogram/2018/05/01/azure-resource-manager/
![Page 42: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/42.jpg)
Videos
@MarkWarneke
• https://app.pluralsight.com/library/courses/microsoft-azure-resource-manager-mastering/table-of-contents
• https://channel9.msdn.com/Events/Build/2015/3-618
• https://channel9.msdn.com/Events/Build/2015/2-659
• https://channel9.msdn.com/Events/Ignite/2015/BRK4453
![Page 43: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/43.jpg)
@MarkWarneke
Blogs
Azure Security Audits with Pester: https://samcogan.com/azure-security-audits-with-pester/
Infrastructure as Code Maturity Model: https://medium.com/@GaryStafford/infrastructure-as-code-maturity-model-9206b21d5dad
An introduction to infrastructure testing with PowerShell Pesterhttps://4sysops.com/archives/an-introduction-to-infrastructure-testing-with-powershell-pester/
![Page 44: Test Infrastructure as Code? - markwarneke.me · Infrastructure as code is an approach to infrastructure automation based on practices from software development. It emphasizes consistent,](https://reader031.vdocuments.us/reader031/viewer/2022040216/5f23648672118f4b8a3bfe66/html5/thumbnails/44.jpg)
http://aka.ms/mark/
github.com/MarkWarneke
@MarkWarneke