Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pulumi de Azure IaC

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Pulumi de Azure IaC

Azure Globalの登壇資料です。

Avatar for dora56

dora56

May 13, 2023
Tweet

More Decks by dora56

Other Decks in Technology

Transcript

  1. 花岡⿓ 役職︓エンジニア 趣味︓読書 資格︓ CKA, DevOps Engineer Expert, Azure Developer

    Associate, 認定スクラムマスター,GitHub Copyright © Alterbooth Inc. All Rights Reserved. 2
  2. • Pulumiとは • Pulumiのコンセプト • BicepやTerraformとの違い • Pulumiの基本的なコマンド • デモ

    • Tips • GitHub Copilot • Pulumi AI アジェンダ Copyright © Alterbooth Inc. All Rights Reserved. 3
  3. BicepやTerraformとの違い • Bicep • ARM Templeteのラッパー⾔語 • 状態管理はせず増分デプロイ • Terraform

    • HCLというドメイン特化⾔語 • ローカルまたはTerraform Cloud ⽐較対象 Pulumi Terraform Bicep ⾔語 .NET Python Go など HCL(DSL) DSL 学習コスト 低 中 中 状態管理 ◦ ◦ × ARM REST API サポート ◦ △ ◦ ドキュメント △ ◦ ◦ Copyright © Alterbooth Inc. All Rights Reserved. 5
  4. Pulumiのコンセプト • プロジェクト︓プログラムのソースコードと 実⾏⽅法のメタデータが含まれるディレクトリ • Program: ⼀般的なプログラミング⾔語で 書かれたクラウドインフラの構成 • Resource:

    インフラリソースの望ましい状態を 記述したオブジェクト • Stack︓プログラムの独⽴した設定可能な インスタンス • クラウドの状態はStateと呼ばれるメタデータを Pulumi Cloudまたはオブジェクトストレージで管理 • 開発、ステージング、本番環境などの異なる スタックが利⽤可能 Copyright © Alterbooth Inc. All Rights Reserved. 6 Intro to Pulumi: Architecture & Concepts | Pulumi Docs
  5. • Pulumi プロジェクトの作成(C#の場合) • mkdir first-project && cd first-project •

    pulumi new azure-csharp • Stackへデプロイ • pulumi up • Stackのインフラリソース全削除 • pulumi destroy • リソース変更のプレビュー • pulumi preview • Stackの管理 • pulumi stack • Pulumi CLI Overview | Pulumi Docs 基本的なPulumiのコマンド Copyright © Alterbooth Inc. All Rights Reserved. 7
  6. • PulumiでAzureインフラ構築 • WebAppとSQL Serverを⽴てる • WebAppのリソース削除 • Production環境のStackを追加 •

    テストコードの実⾏ Demoでやること Copyright © Alterbooth Inc. All Rights Reserved. 9 AppServicePlan App Service SQL Server Application Insight
  7. • Pulumiは既存のプログラミング⾔語でインフラ構築ができるツール • 既存のテストツールでテストコードを書くことができる • エディタはVisual Studio, VS Code, Riderなどお好みのものが使える

    • AIの⽀援でIaCがやりやすくなった • Pulumiで Infrastracture as Codeに挑戦してみよう︕ Summary Copyright © Alterbooth Inc. All Rights Reserved. 12