$30 off During Our Annual Pro Sale. View Details »

Build Your Cloud Infrastructure as Code With .Net Core - Build Stuff

Build Your Cloud Infrastructure as Code With .Net Core - Build Stuff

Hossam Barakat

November 19, 2021
Tweet

More Decks by Hossam Barakat

Other Decks in Programming

Transcript

  1. Build Your Azure
    Infrastructure as Code
    With .NET Core
    Hossam Barakat
    Engineering Manager at Willow
    @hossambarakat_ | www.hossambarakat.net

    View Slide

  2. @hossambarakat_
    Data Centers

    View Slide

  3. @hossambarakat_
    Rise of Cloud Computing

    View Slide

  4. @hossambarakat_
    How to provision cloud resources?

    View Slide

  5. @hossambarakat_
    Manual AKA Point and Click

    View Slide

  6. @hossambarakat_
    Manual AKA Point and Click

    View Slide

  7. @hossambarakat_
    Snowflake Servers

    View Slide

  8. @hossambarakat_
    Infrastructure as Code

    View Slide

  9. @hossambarakat_
    • Managing and provisioning cloud resources using
    code.
    Infrastructure as Code

    View Slide

  10. @hossambarakat_
    Imperative: CLI commands and scripts

    View Slide

  11. @hossambarakat_
    Idempotency and error handling

    View Slide

  12. @hossambarakat_
    Declarative Infrastructure as Code

    View Slide

  13. @hossambarakat_
    Tool
    Declarative Infrastructure as Code
    Desired State Actual Resources

    View Slide

  14. @hossambarakat_
    • Azure Resource Manager
    • Terraform
    • Bicep
    • AWS CloudFormation
    • Google Deployment Manager
    • …
    Declarative Infrastructure as Code tools

    View Slide

  15. @hossambarakat_
    • JSON, YAML, domain specific languages (DSLs),…
    Infrastructure as Code tools

    View Slide

  16. @hossambarakat_

    View Slide

  17. @hossambarakat_
    Enter Pulumi

    View Slide

  18. @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?

    View Slide

  19. @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

    View Slide

  20. @hossambarakat_

    View Slide

  21. @hossambarakat_
    Pulumi Fundamentals

    View Slide

  22. @hossambarakat_
    Projects & Stacks
    web-app (Pulumi.yaml) Project
    $ pulumi new
    Stacks
    $ pulumi stack init stackName
    Pulumi..yaml
    Pulumi.yaml

    View Slide

  23. @hossambarakat_
    Configurations
    $ pulumi config set dbPassword S3cr37
    config:
    serverless-app:dbPassword: S3cr37
    Pulumi..yaml
    var config = new Pulumi.Config();
    var password = config.Require("dbPassword");
    Pulumi.cs

    View Slide

  24. @hossambarakat_
    Application architecture on Azure

    View Slide

  25. @hossambarakat_

    View Slide

  26. @hossambarakat_
    But that would be imperative, right?

    View Slide

  27. @hossambarakat_
    How Pulumi Works
    State
    CLI and Engine
    AWS
    Azure
    Kubernetes
    Providers
    Code
    Plan
    Apply
    new Resource()

    View Slide

  28. @hossambarakat_
    Continuous Deployment
    Infrastructure as
    Code
    Manual
    Review
    State

    View Slide

  29. @hossambarakat_
    GitHub Integration

    View Slide

  30. @hossambarakat_
    Summary

    View Slide

  31. @hossambarakat_
    Questions?

    View Slide

  32. Thanks
    Hossam Barakat
    @hossambarakat_
    www.hossambarakat.net

    View Slide