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

実践!CloudFormation Best Practice

Avatar for urmot urmot
December 20, 2018

実践!CloudFormation Best Practice

Avatar for urmot

urmot

December 20, 2018
Tweet

More Decks by urmot

Other Decks in Programming

Transcript

  1. 目次 • 自己紹介 • 背景 • 解説!CloudFormation Best Practice •

    実践!CloudFormation Best Practice • まとめ
  2. 解説!CloudFormation Best Practice 例: 期間限定のキャンペーン用のサーバをつくる Campaign EC2 Campaign ELB WebSite

    ELB WebSite EC2 S3 RDS キャンペーン終了後 使ったリソースを 削除したい
  3. 解説!CloudFormation Best Practice 例: 期間限定のキャンペーン用のサーバをつくる Campaign EC2 Campaign ELB WebSite

    ELB WebSite EC2 S3 RDS キャンペーン終了後 使ったリソースを 削除したい
  4. 解説!CloudFormation Best Practice 例: 期間限定のキャンペーン用のサーバをつくる Campaign EC2 Campaign ELB WebSite

    ELB WebSite EC2 S3 RDS キャンペーン終了後 使ったリソースを 削除したい キャンペーンでS3 使ってたっけ?
  5. 解説!CloudFormation Best Practice 例: 期間限定のキャンペーン用のサーバをつくる Campaign ELB Campaign EC2 S3

    WebSite ELB WebSite EC2 S3 RDS キャンペーン終了は キャンペーンのStack を削除するだけ
  6. 解説!CloudFormation Best Practice 解決策: キャンペーン用のStackを別に作成する Campaign ELB Campaign EC2 S3

    WebSite ELB WebSite EC2 S3 RDS キャンペーン終了は キャンペーンのStack を削除するだけ キャンペーンリソースが 削除された事による影 響を閉じられる
  7. 解説!CloudFormation Best Practice 解決策: WebチームとDBチームでStackを分ける EC2 ELB RDS Parameter Groups

    Security Group Security Group EC2 ELB RDS Security Group Parameter Groups Security Group
  8. 解説!CloudFormation Best Practice 解決策: WebチームとDBチームでStackを分ける EC2 ELB RDS Security Group

    Parameter Groups Security Group 更新タイミング の調整は不要 影響範囲もStack内 で確認できればOK
  9. 解説!CloudFormation Best Practice • SOA = Service Oriented Architecture ◦

    ServiceをNetwork上で連携させてシステムの全体構成をしていく ◦ Service: 業務上の一処理 • 多層アーキテクチャ ◦ アプリケーションを複数の層に分け, 独立したモジュールとして開発 ◦ 各層はその直下の層に依存する おまけ: 詳細なStackの分け方は多層アーキテクチャとSOAが使える(らしい)
  10. • StackとTemplateは別の概念と認識する • Template: 呼び出す際に値を注入して利用 • Stack: AWSリソースを作るための情報を全て持つ • テンプレートが膨大になることを防ぐ

    ◦ どこに何を書けばよいかわからない状態を防げる 解説!CloudFormation Best Practice ネストされたスタックを使用して共通パターンを再利用する