book.impress.co.jp
AWSにおける運用の考え方
AWSにおける運用の考え方
- コードによるオペレーション実行
- 定期的に、小規模で、元に戻すことができる変更を行う
- 構築して終わりではない
- 定期的な更新を行う前提で設計せよ
- 運用手順を見直す
- システムの進化に見合った運用手順を確保して運用の品質向上・維持
- 障害発生を想定する
- 障害発生時の影響を正確に把握
- 対応手順もテストする
- 対応手順が正しいことの確認
- 運用チームが障害対応の内容を正しく理解していることの確認
- 運用の失敗をもとに改善する
作業の自動化
コードによるインフラストラクチャ構成管理
- 従来のインフラ構築の課題点
- ミスが発生しうる
- インフラストラクチャ構築手順のバージョン管理が必要(煩雑)
- アプリケーションのデプロイもそうだった
- 今ではデプロイ作業の自動化により改善
- IaC: Infrastructure as Code
- インフラでもアプリケーションと同じことをしようよ
- コード管理
- 作業自動化
- CloudFormation
- テンプレート
- スタック
- テンプレートにより自動的にプロビジョニングされるリソースの集合
項目名 |
説明 |
AWSTemplateFormatVersion |
テンプレートのバージョン |
Description |
テンプレートの説明 |
Parameters |
カスタム値の定義 ({"Ref": ... } で参照可能) |
Resources |
AWSリソースのプロビジョニング設定の連想配列 |
Outputs |
スタック作成後に出力する項目の指定(SNSTopicとか) |
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template AutoScalingMultiAZWithNotifications: Create a multi-az, load balanced and Auto Scaled sample web site running on an Apache Web Serever. The application is configured to span all Availability Zones in the region and is Auto-Scaled based on the CPU utilization of the web servers. Notifications will be sent to the operator email address on scaling events. The instances are load balanced with a simple health check against the default web page. **WARNING** This template creates one or more Amazon EC2 instances and an Application Load Balancer. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"VpcId" : {
"Type" : "AWS::EC2::VPC::Id",
"Description" : "VpcId of your existing Virtual Private Cloud (VPC)",
"ConstraintDescription" : "must be the VPC Id of an existing Virtual Private Cloud."
},
...
"Resources" : {
"NotificationTopic": {
"Type": "AWS::SNS::Topic",
"Properties": {
"Subscription": [ { "Endpoint": { "Ref": "OperatorEMail" }, "Protocol": "email" } ]
}
},
"WebServerGroup" : {
...
"Outputs" : {
"URL" : {
"Description" : "The URL of the website",
"Value" : { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [
"ApplicationLoadBalancer", "DNSName" ]}]]}
}
}
}
自動化できるサービスとその機能
- CodeCommit
- CodePipeline
- アプリケーションのビルド、テスト、デプロイまでの処理手順を定義し、実行できる
- CodeDeploy
- Elastic Beanstalk
- 実行環境の管理、アプリケーションやサービスのデプロイ
- OpsWorks
- CloudFormation
- AWS内のすべてのインフラストラクチャリソースを自動でプロビジョニング
運用に関するその他のサービス
モニタリング
サポート
- サービスの稼働状況監視
- AWSサポート
- AWSのエンジニアがユーザーをサポート
- サポートプラン
- サポートプランにより、問い合わせ方法や対応する緊急度がかわる