Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build Your Cloud Infrastructure as Code With .N...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hossam Barakat
April 19, 2020
Programming
170
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Build Your Cloud Infrastructure as Code With .Net Core - NDC Porto 2020
Hossam Barakat
April 19, 2020
More Decks by Hossam Barakat
See All by Hossam Barakat
Build Your Cloud Infrastructure as Code With .Net Core - Build Stuff
hossambarakat
0
91
Kubernetes Blue-Green Deployment Made Easy with Argo Rollouts - ADDO
hossambarakat
0
150
Build Your Azure Infrastructure as Code With .NET Core - Azure Day
hossambarakat
0
47
Build Your Azure Infrastructure as Code With .Net Core - Global Azure 2021
hossambarakat
0
68
Practical Domain-Driven Design with EF Core - NDC London 2021
hossambarakat
0
260
Build Your Cloud Infrastructure as Code With .Net Core - ADDO 2020
hossambarakat
0
160
Practical Domain Driven Design With EFCore - NDC Sydney 2020
hossambarakat
0
140
Kubernetes for Developers - All Day DevOps
hossambarakat
2
190
Secure your Kubernetes Containers - All Day DevOps
hossambarakat
0
140
Other Decks in Programming
See All in Programming
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
0
220
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.3k
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
230
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
110
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2k
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.4k
JavaDoc 再入門
nagise
0
320
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
240
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
450
Contextとはなにか
chiroruxx
1
290
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
110
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
210
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Building an army of robots
kneath
306
46k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
530
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
180
4 Signs Your Business is Dying
shpigford
187
22k
Between Models and Reality
mayunak
4
330
Accessibility Awareness
sabderemane
1
140
A Soul's Torment
seathinner
6
2.9k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
450
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
190
Transcript
Build Your Cloud Infrastructure as Code With .Net Core Hossam
Barakat Technical Lead at Willow @hossambarakat_ | www.hossambarakat.net
@hossambarakat_ • Intro to Infrastructure as code • Your First
Pulumi Program • Pulumi Fundamentals • Serverless Application • Continuous Delivery • Testing Agenda
@hossambarakat_ Data Centers
@hossambarakat_ Rise of Cloud Computing
@hossambarakat_ How to provision cloud resources?
@hossambarakat_ Manual AKA Point and Click
@hossambarakat_ Manual AKA Point and Click
@hossambarakat_ Snowflake Servers
@hossambarakat_ Infrastructure as Code
@hossambarakat_ • Managing and provisioning cloud resources using code. Infrastructure
as Code
@hossambarakat_ Imperative: CLI commands and scripts
@hossambarakat_ Idempotency and error handling
@hossambarakat_ Declarative Infrastructure as Code
@hossambarakat_ Tool Declarative Infrastructure as Code Desired State Actual Resources
@hossambarakat_ • Azure Resource Manager • AWS CloudFormation • Google
Deployment Manager • Terraform • … Declarative Infrastructure as Code tools
@hossambarakat_ • YAML, domain specific languages (DSLs),… Infrastructure as Code
tools
@hossambarakat_ https://noyaml.com/
@hossambarakat_
@hossambarakat_ Enter Pulumi
@hossambarakat_ • Pulumi is an open source infrastructure as code
tool the lets you use real languages – C#, TypeScript, Go,… – to provision and manage cloud resources. What is Pulumi?
@hossambarakat_ • Control flow with loops and if conditions •
Abstraction with functions, classes, packages,… • Code sharing with package management (Nuget, npm,…) • Authoring with favourite IDEs, refactoring, code completion, static type checking • Testing with existing frameworks and tools Benefits
@hossambarakat_
@hossambarakat_ Terraform vs Pulumi var resourceGroup = new ResourceGroup("pulumi-resources", new
ResourceGroupArgs { Location = "West Europe" }); ); var environments = new string[]{"dev", "uat", "prod"}; foreach (var environment in environments) { var storageAccount = new Account($"storage{environment}", new AccountArgs { Name = $"iacpulumi{environment}", ResourceGroupName = resourceGroup.Name, Location = resourceGroup.Location, AccountReplicationType = "LRS", AccountTier = "Standard", }); } resource "azurerm_resource_group" "rg" { name = "terraform-resources" location = "West Europe" } variable "environments" { description = "storage account regions" type = list(string) default = ["dev", "uat", "prod"] } resource "azurerm_storage_account" "sa" { name = "iacpulumi${var.environments[count.index]}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location account_tier = "Standard" account_replication_type = "LRS" count = length(var.environments) }
@hossambarakat_ Pulumi Fundamentals
@hossambarakat_ Projects & Stacks web-app (Pulumi.yaml) Project $ pulumi new
Stacks $ pulumi stack init stackName Pulumi.<stack-name>.yaml Pulumi.yaml
@hossambarakat_ Configurations $ pulumi config set dbPassword S3cr37 config: serverless-app:dbPassword:
S3cr37 Pulumi.<stack-name>.yaml var config = new Pulumi.Config(); var password = config.Require("dbPassword"); Pulumi.cs
@hossambarakat_ Secrets $ pulumi config set --secret dbPassword S3cr37 var
config = new Pulumi.Config(); var password = config.Require("dbPassword"); Pulumi.cs Pulumi.<stack-name>.yaml config: serverless-app:dbPassword: secure: AAABAELDrCQE+rQbzTxN43iAD6iGDXTYQ90AzpILkfEY3uwtc+g=
@hossambarakat_ But that would be imperative and not declarative?
@hossambarakat_ How Pulumi Works State CLI and Engine AWS Azure
Kubernetes Providers Code Plan Apply new Resource()
@hossambarakat_ Application architecture on Azure
@hossambarakat_ Cosmos DB Resources Cosmos Account Sql Database Container
@hossambarakat_ Function App Resources Storage account App Service Plan Function
App Container Blob
@hossambarakat_
@hossambarakat_ Architecture as {Code} https://aws.amazon.com/blogs/containers/containers-and-infrastructure-as-code-like-peanut-butter-and-jelly/ Static website Function App Cosmos
DB
@hossambarakat_ Continuous Deployment Infrastructure as Code Manual Review
@hossambarakat_ Testing Unit Testing Integration Testing
@hossambarakat_ Unit Testing [Fact] public async Task AllResourceGroups_Should_Have_ProductName_Tag() { var
resources = await TestAsync<MyStack>(); var resourceGroups = resources.OfType<Pulumi.Azure.Core.ResourceGroup>(); resourceGroups.ShouldAllBe(rg =>rg.Tags.GetValue().ContainsKey("productname")); }
@hossambarakat_ Summary
@hossambarakat_
@hossambarakat_ • https://github.com/hossambarakat/pulumi-demos • http://pulumi.com/docs • https://github.com/pulumi/examples Resources https://bit.ly/pulumi-ndc-porto
@hossambarakat_ Questions?
Thanks Hossam Barakat @hossambarakat_ www.hossambarakat.net