SlideShare a Scribd company logo
1 of 68
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS 公式 Webinar
https://amzn.to/JPWebinar
過去資料
https://amzn.to/JPArchive
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar & AWS CodePipeline
サービスカットシリーズ
[AWS Black Belt Online Seminar]
Solutions Architect 山口 弘樹
2020/11/11
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Black Belt Online Seminar とは
「サービス別」「ソリューション別」「業種別」のそれぞれのテーマに分かれて、アマゾ
ン ウェブ サービス ジャパン株式会社が主催するオンラインセミナーシリーズです。
質問を投げることができます!
• 書き込んだ質問は、主催者にしか見えません
• 今後のロードマップに関するご質問は
お答えできませんのでご了承下さい
Twitter ハッシュタグは以下をご利用ください
#awsblackbelt
① 吹き出しをクリック
② 質問を入力
③ Sendをクリック
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
内容についての注意点
• 本資料では2020年11月11日時点のサービス内容および価格についてご説明しています。最新の情
報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。
• 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違
があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。
• 価格は税抜表記となっています。日本居住者のお客様には別途消費税をご請求させていただきま
す。
• AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to
change in accordance with the AWS Customer Agreement available at
http://aws.amazon.com/agreement/. Any pricing information included in this document is
provided only as an estimate of usage charges for AWS services based on certain information that
you have provided. Monthly charges will be based on your actual use of AWS services, and may
vary from the estimates provided.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
 名前
山口 弘樹(やまぐち ひろき)yamaghi@
 所属
アマゾン ウェブ サービス ジャパン株式会社
パートナーソリューションアーキテクト
 経歴
国内 SIer で主に PM / PL や上級 SE を担当
Spring Boot を使った MSA システム設計、アジャイル開発の推進
 好きなAWSサービス
AWS Code シリーズ
自己紹介
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本セミナーの概要
❑ 本セミナーで学習できること
❖ AWS CodeStar、AWS CodePipelineの機能概要
❖ CI/CD を構築する際の一般的な構成
❑ 対象者
❖ AWS CodeStar、AWS CodePipelineにご興味がある方
❖ これから CI/CD を検討している方、または既にCI/CD を導入している方
 定期的に機能拡充を行っているアプリケーションエンジニア、
または開発を支えるインフラエンジニア
 機能拡充頻度は低いが CI/CD を通してプロセスの自動化を図りたい方
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
新たなマーケット
新たな顧客価値New economics
新たなデジタル製品とサービス
急速なイノベーションがビジネスを進化させる
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ListenIdeas
アイデア
Experiment
Innovation
Flywheel
お客様の声
実験
実験がイノベーションを加速する
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ソフトウェア開発手法の潮流の変化
複雑で変化の激しい問題に対応し、可能な限り価値の高いプロダクトを
生産的かつ創造的に届けるための開発方法論が求められるようになった
 スクラムやXPなどアジャイル型開発が浸透
 デザイン思考などユーザーを理解し、
仮説立てて問題解決する設計手法
http://agilemanifesto.org/iso/ja/manifesto.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ソフトウェア開発のライフサイクル
1way:リードタイム短縮 2way:Feedbackを元に改善 3way:継続的な実験と学び
AWS が考える DevOps
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
30x頻繁なデプロイ
440xリードタイムの短縮
60xミスが減少
-21%予期しない作業の削減
+44%新しい作業
https://puppet.com/resources/whitepaper/2017-state-of-devops-report
CI/CDを利用して高品質な機能を迅速にリリースする
CI/CDを自動化しているチームは
コードをより速く、自信を持って書いている
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• 他のシステムと
の統合テスト
• ロードテスト
• UIテスト
• 侵入テスト
• ソースコードを
チェックイン
• バージョン管理、
ブランチ管理
• 新しいコードの
ピアレビュー
• Java、C#などの
コードのコンパイル
• ユニットテスト
• スタイルチェッカー
• コードメトリック
• コンテナイメージの
作成
• 本番環境に
デプロイ
リリースプロセスに求められる 4 つのフェーズ
Source Build Test Deploy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
リリースプロセスのレベル
Source Build Test Deploy
継続的インテグレーション (CI)
継続的デリバリ (CD)
継続的デプロイメント (CD)
承認してからリリース
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline
CI/CD の実現を容易にするAWS Code サービス
MONITORDEPLOYTESTBUILD
SOURCE /
ARTIFACT
AUTHOR
AWS CodeBuild
+ Third Party
AWS
CodeCommit
AWS CodeBuild AWS
CodeDeploy
AWS
X-Ray
AWS Cloud9
AW IDE Toolkits
Amazon
CloudWatch
AWS
CodeArtifact
Amazon CodeGuru
AWS CodeStar
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS を活用した CI/CD の特徴
低コストと
無料利用枠
承認アクションと
ステージ移行
任意のアクションは
コードベースで定義可能
AWSサービスとの
シームレスな連携
マネージドサービスによる
高い可用性と信頼性
サードパーティーツールとの
インテグレーション
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar の概要
 AWS上での開発をわずか数分間で開始
 チームをまたがった開発をセキュアに
 ソフトウェア デリバリーの管理を容易に
 様々なプロジェクトテンプレートから選択
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
豊富なプロジェクトテンプレート
プロジェクトテンプレートを選ぶと CI/CD 環境が自動で作成される
(※テンプレートの一部のみ記載)
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
プロジェクト ダッシュボード
ダッシュボードを通して、リポジトリやパイプラインが可視化
App
エンドポイント
CloudWatch
メトリクス
Repository
エンドポイント
開発ツール
との連携
デリバリー
パイプライン
統合メニュー
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
パイプラインの自動生成
ステージとして、ソース・ビルド・デプロイが構築される
Source
Build
Deploy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
開発ツールとの連携
開発ツールとして AWS Cloud9 も同時にデプロイできる
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
セットアップ内容
• プロジェクトテンプレートの選択
• EC2 or Beanstalk or Lambda
• プロジェクトの設定
• リポジトリ(CodeCommit、GitHub)
• プロジェクトの編集
• プロジェクトダッシュボード
• CodePipeline 継続的デプロイメントパイプライン
• CloudWatchメトリクス
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar の操作: プロジェクトを作成
1. テンプレートからサンプルプロジェクトを選択
2. プロジェクト名、リポジトリ情報などを入力し、あとは数分間待つだけ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar の操作: チームメンバを追加・削除
• 既存のチームメンバー、またはIAMユーザーからユーザーの追加が可能
• 表示名、メールアドレス、ロールを指定して簡易にプロジェクトメンバーを作成できる
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodeStar の料金
AWS CodeStar に対する追加料金は発生しません
• CodeStar プロジェクトでプロビジョニングされた AWS リソース
(例: Amazon EC2 インスタンス、AWS Lambda の実行、Amazon EBS ボ
リューム、Amazon S3 バケット) に対してのみ料金が発生します。
https://aws.amazon.com/jp/codestar/pricing/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline 概要
 素早く信頼性の高いアプリケーション更新のため
の継続的デリバリーサービスを提供
 ソフトウェアリリースプロセスをモデル化する
ことにより視覚化
 コードが変更されるとコードのビルド、テスト、
デプロイを実施
 AWSサービスやサードパーティーのツールと統合
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ソースコード
ビルド
ユニット
テスト
ステージ
デプロイ
本番
デプロイ
A機能画面
テスト
CodePipeline
ステージ
デプロイ
B機能画面
テスト
開発のスタイルに合ったパイプラインを自在に構築
パイプラインは開発チームやサービスにより異なる
スムーズなデプロイメントにはパイプラインは欠かせない
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の定義
MyApp
CodeCommit
Source
Build
CodeBuild
Build
DeployToInteg
CodeDeploy
Integration
IntegTest
End2EndTester
DeployToProd
CodeDeploy
Production
ソース
ビルド
検証環境
デプロイ
テスト実行
本番環境
デプロイ
アクション
ステージ
パイプライン
トランジション
入力アーティファクト
出力アーティファクト
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの作成
• パイプライン名を指定する
• 任意のサービスロールを指定する
• 高度な設定(アーティファクトストア、
暗号化キー)はオプション
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの作成
• ソースプロバイダーを指定する
• ソースプロバイダーに紐づく情報を
指定する(例: AWS CodeCommitのリ
ポジトリ名やブランチ名)
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの作成
• ビルドステージはオプショナル
(コンパイル言語の場合は指定)
• ビルドプロバイダーを指定する
• ビルドプロバイダーに紐づく情報を
指定する(例: リージョン、アプリ
ケーション名など)
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの作成
• デプロイステージはオプショナル
(CDを行う場合は指定)
• デプロイプロバイダーを指定する
• デプロイプロバイダーに紐づく情報を
指定する(例: リージョン、アプリ
ケーション名など)
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの作成
..
• パイプライン構成を確認し、
作成を選択
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの編集
..
• パイプラインの編集で、作成したステー
ジやアクションを編集可能
• 後からアクションやステージを追加可能
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの実行開始、停止
• パイプラインの開始・停止が可能。
• リリースに問題が含まれていることに
気付いた場合、それ以上のデプロイから
リリースをすぐに停止可能に。
https://aws.amazon.com/jp/about-aws/whats-new/2020/01/aws-codepipeline-enables-stopping-pipeline-executions/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの実行履歴を表示
• パイプラインで最後に実行されたアク
ション、ステージ間のトランジション、
失敗した結果など、詳細を表示する
• 実行履歴は最大12ヶ月間保存
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CodePipeline の操作: パイプラインの実行結果の通知
• リポジトリ、ビルドプロジェクト、デプ
ロイ、およびパイプラインのイベントに
関する通知を送信する
• 通知はAmazon SNSで送信される
https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
参考資料: ビルドやテスト結果をSlack等に通知する
https://aws.amazon.com/jp/blogs/news/receive-aws-developer-tools-notifications-over-slack-using-aws-chatbot/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
参考資料: ビルドやテスト結果をSlack等に通知する
 AWS Chatbot を利用して AWS 開発者用ツールの通知を Slack で受け取る方法
https://aws.amazon.com/jp/blogs/news/receive-aws-developer-tools-
notifications-over-slack-using-aws-chatbot/
 ウェブフックを使用して Amazon SNS メッセージを Amazon Chime、Slack や
Microsoft Teams に発行する方法を教えてください。
https://aws.amazon.com/jp/premiumsupport/knowledge-center/sns-lambda-
webhooks-chime-slack-teams/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline がサポートしているプロバイダー
・Source
₋ AWS CodeCommit
₋ Amazon ECR
₋ Amazon S3
₋ Bitbucket
₋ GitHub
₋ GitHub Enterprise Server
・Build
₋ AWS CodeBuild
₋ CloudBees
₋ Jenkins
₋ TeamCity
・Test
₋ AWS CodeBuild
₋ AWS Device Farm
₋ BlazeMeter
₋ Jenkins
₋ GhostInspector
₋ Micro Focus StormRunner Load
₋ Nouvola
₋ Runscope
https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/integrations-action-type.html
https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline がサポートしているプロバイダー
・Deploy
₋ AWS CodeDeploy
₋ AWS CloudFormation
₋ Amazon S3
₋ Amazon ECS
₋ Amazon ECS (Blue/Green)
₋ Elastic Beanstalk
₋ AWS AppConfig
₋ AWS OpsWorks
₋ AWS Service Catalog
₋ Amazon Alexa
₋ XebiaLabs
・Approval
₋ Manual
・Invoke
₋ AWS Lambda
₋ AWS Step Functions
https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/integrations-action-type.html
https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline と統合可能な製品
Source Build Test Deploy
https://aws.amazon.com/jp/codepipeline/product-integrations/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Custom アクション
デフォルトで用意されていない独自のアクションを追加可能
AWS CLI を使ってパイプラインにカスタムアクションを作成
Job Worker の作成が必要
• Customアクションに対するAWS CodePipelineのジョブリクエストを
ポーリング
• Custom Jobの実行
• 結果のステータスをAWS CodePipelineに返す
• AWS CodePipelineから参照可能なパブリックなエンドポイントを公開
http://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/actions-create-custom-action.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Custom アクション
開発者が
コミット
カスタムアクションリソース
カスタムビルドアクション
1. エージェントでポーリング
2. ジョブの詳細
4. ビルドの実行
5. ジョブの成功
カスタムジョブワーカー
3. ジョブのAck
Amazon S3AWS CodePipeline
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda ファンクションの実行
AWS CodePipeline のアクションとして Lambda を呼び出し可能
Lamdba ファンクションの利用例:
• AWS CloudFormation を使用して、任意のタイミングでリソース作成・削除
• Lambda ファンクション で CNAME をスワップすることでゼロダウンタイムでの
バージョンアップを ElasticBeanstalk で実行
• AMI スナップショットを作成することで構築、デプロイする前にリソースの
バックアップを作成
• IRC クライアントにメッセージをポストするなど、サードパーティーの製品と統合
https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Lambda.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Step Function の実行
AWS CodePipelineのアクションとして AWS Step Function を呼び出し可能
リリースプロセスの一部として複雑なワークフローを呼び出すことができる
AWS Step Function の利用例:
• 条件付き分岐、エラー処理、および非同期タスクを行う処理
• 他の AWS のサービスとの連携
• シンプルなリリースパイプラインを維持し、複雑なワークフローの動作を Step
Functions ステートマシンエンジンに委任する
https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-StepFunctions.html
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Approval アクション
・パイプラインに承認アクションを追加し承認されたら次のステージへ
・SNS トピックをあわせて指定することでメールで通知
・承認アクションの例
• リビジョンが次のステージに進む前にコードレビュや変更管理レビューを依頼
• 手動の品質管理テストを最新バージョンのアプリケーションに実施を依頼
• リリース前にビルドされた成果物の統合確認を依頼
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
並列アクションと逐次アクション
Source
Source
GitHub
Build
JenkinsOnEC2
Jenkins
Deploy
JavaApp
Elastic Beanstalk
NotifyDevelopers
Lambda
MyApplication
並列アクション
Source
Source
GitHub
Build
JenkinsOnEC2
Jenkins
Deploy
JavaApp
Elastic Beanstalk
NotifyDevelopers
Lambda
TestAPI
Runscope
MyApplication
逐次アクション
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
実行時のアクション間の変数引き渡し
パイプライン内でアクション間の変数受け渡しが可能に。
従来はアクション間で受け渡しは出来なかったが、変数を元に評価をすることで、
よりダイナミックなアクションが記述可能となった。
利用例:
• CodeCommit ソースアクションが出力するコミットメッセージを元に、
手動認証操作のためのカスタムメッセージを定義する
• エンドポイント URL の生成をデプロイステージで行い、
その後に続くテストアクションでテストする
• カスタムワークフローにおいては、Lambda アクションが出力する変数を、
それに呼応するアクションで自由に使用できる
https://aws.amazon.com/jp/about-aws/whats-new/2019/11/aws-codepipeline-enables-passing-variables-between-actions-at-
execution-time/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Source
XXX
CodeCommit
Build
XXX
CodeBuild
Deploy
XXX
Amazon ECS
ソースアーティファクト
ビルドアーティファクト
4. ソースアーティファクト
を取得
1. 変更を取得
5. ビルドアーティファクト
を格納
3. ビルドを実行
6. 成功を通知
7. CodePipelineでイメージを更新
MyApplication
AWS CodeCommit
Amazon ECS
Amazon ECR
AWS CodeBuild
構成例: Amazon ECS での CI/CD パイプライン
Amazon S3
8. ビルドアーティ
ファクトを取得
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
8. ビルドアーティ
ファクトを取得
Source
XXX
CodeCommit
Build
XXX
CodeBuild
Deploy
XXX
CodeFormation
4. ソースアーティファクトを取得
1. 変更を取得
5. ビルドアーティファクトを格納
3. ビルドを実行
6. 成功を通知
7. CloudFormationで環境を構築
MyApplication
AWS CodeCommit
AWS CloudFormation
AWS CodeBuild
構成例: サーバーレス での CI/CD パイプライン
Amazon S3
9. 展開
Amazon
DynamoDB
AWS
Lambda
Amazo API
Gateway
ビルドアーティファクト
ソースアーティファクト
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Source
XXX
CodeCommit
Build
XXX
CodeBuild
Deploy
XXX
Beanstalk
1. 変更を取得
3. ジョブをポーリング
4. ジョブを承認
7. 成功を通知
MyApplication
GitHub
構成例: GitHub, Jenkins との連携
Amazon S3Jenkin
Javaアプリ
5. ソースアーティファクトを取得
6. ビルドアーティファクトを格納
ビルドアーティファクト
ソースアーティファクト
8. AWS Elastic Beanstalkで環
境を構築
AWS Elastic Beanstalk
10. 展開
9. ビルドアーティ
ファクトを取得
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline のクォータ
https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/limits.html
Resource デフォルト値
アクションがタイムアウトするまでの
時間
Approvalアクション: 7 日間
AWS CloudFormation デプロイアクション: 3 日間
CodeBuild ビルドアクションおよびテストアクション: 8 時間
CodeDeploy および CodeDeploy ECS (blue/green) デプロイアクション: 5 日
間
AWS Lambda の呼び出しアクション: 24 時間
AWS アカウントのリージョンあたりの
全パイプラインの最大数
300
AWS リージョンごとにソース変更の
ポーリングに設定するパイプラインの
最大数
60
AWS アカウントのリージョンあたりの
ウェブフックの最大数
300
AWS アカウントのリージョンあたりの
カスタムアクションの数
50
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline の料金
アクティブパイプライン* 1つに対して、1.00 USD / 月
• 実験を奨励するため、パイプラインは作成後の最初の 30 日間は無料
• アクティブパイプライン*とは、30日以上存在していて、
その月に1つのコード変更が発生したパイプライン
• その月に新しいコード変更がないパイプラインに対しては
料金は発生しません
• 1ヶ月に満たない分に対しては按分計算されません
無料利用枠
• アクティブなパイプラインを1か月あたり1つ無料
https://aws.amazon.com/jp/codepipeline/pricing/
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
インターネットを経由せずにパイプラインを作るには?
AWS CodePipeline
AWS CodeDeploy
Amazon Route 53
Direct Connect
Amazon EC2
AWS CodeBuild
AWS CodeCommit
クライアント端末
VPC エンドポイントを経由するとインターネットにアクセスすることなくサービスと連携が可能。
AWS CodeCommit、AWS CodeBuild、AWS CodeDeploy は VPC エンドポイントに対応している。
クライアント端末から VPC エンドポイント経由で AWS CodeCommit にコミットする。
AWS CodePipeline 内はAWSサービス間のため閉域網で連携する。
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
開発・検証・本番のパイプラインをどう作れば良いか?
https://aws.amazon.com/jp/blogs/devops/implementing-gitflow-using-aws-codepipeline-aws-codecommit-aws-
codebuild-and-aws-codedeploy/
基本的には、ブランチ毎にパイプラインを分けて構築する。
環境別の差分は環境変数として定義し、CodePipelineから設定する。
master
hotfix
release
develop
V0.1
feature
V1.0
AWS CodePipeline
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
参考資料: AWS Developer Tools を活用した Git-flow
https://gitflow-codetools.workshop.aws/https://d1.awsstatic.com/events/reinvent/2019/REPEAT_2_I
mplementing_GitFLow_with_AWS_tools_DOP202-R2.pdf
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
クロスアカウントでパイプラインを作るには?
https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create-cross-account.html
https://aws.amazon.com/jp/blogs/devops/aws-building-a-secure-cross-account-continuous-delivery-pipeline/
Amazon EC2AWS CodeCommit
codecommit-
service-role
Amazon S3
AWS CodePipeline
AWS CodeDeployAWS CodeBuild
Assume Role
Assume Role でアクセス権限を委任することで連携が可能。
注意点として、アカウントを跨いでアーティファクトを受け渡すため、S3バケットならびにAWS KMSキーをク
ロスアカウントアクセスを有効にする必要がある。またクロスアカウントパイプラインの制限内でアクセスでき
るように構成を組む必要がある。
AWSCodePipeline
ServiceRole
codebuild-
service-role
codedeploy-
service-role
AWS KMS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://cross-account-cicd-pipeline.workshop.aws/
参考資料: Cross-Account CI/CDパイプライン ワークショップ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
本日のアジェンダ
• CI/CD が必要となる背景
• AWS CodeStar の機能説明
• AWS CodePipeline の機能説明
• よくあるご相談
• まとめ
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
まとめ
• AWS CodeStar は、テンプレートベースで CI/CD 環境を素早く構築でき、
ダッシュボードで一元管理できる。CI/CD 環境を試してみたい方はオススメ。
• AWS CodePipeline は、リリースプロセス全体を一貫したやり方で完全に自動
化できる。AWS が揃えているソース、ビルド、デプロイのサービス群とでき
るほか、サードパーティー製品とも連携ができる。
• 急速なビジネススピードに応えるためには、CI/CDは必須。
これらサービスを活用することで高品質なソフトウェアをインクリメンタル
な開発手法で素早くリリース!
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Q&A
お答えできなかったご質問については
AWS Japan Blog 「https://aws.amazon.com/jp/blogs/news/」にて
後日掲載します。
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS の日本語資料の場所「AWS 資料」で検索
https://amzn.to/JPArchive
67
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
毎週” 個別技術相談会”を実施中
• のソリューションアーキテクト に
対策などを相談することも可能
• 申込みはイベント告知サイトから
(https://aws.amazon.com/jp/about-aws/events/)
AWS Well-Architected 個別技術相談会
68
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS 公式 Webinar
https://amzn.to/JPWebinar
過去資料
https://amzn.to/JPArchive
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ご視聴ありがとうございました

More Related Content

What's hot

20190919 よくご相談いただくセキュリティの質問と考え方
20190919 よくご相談いただくセキュリティの質問と考え方20190919 よくご相談いただくセキュリティの質問と考え方
20190919 よくご相談いただくセキュリティの質問と考え方
Amazon Web Services Japan
 

What's hot (20)

20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration Service20210216 AWS Black Belt Online Seminar AWS Database Migration Service
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
 
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
[AWS EXpert Online for JAWS-UG 18] 見せてやるよ、Step Functions の本気ってやつをな
 
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic BeanstalkAWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
AWS Black Belt Online Seminar 2017 AWS Elastic Beanstalk
 
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
AWS Black Belt Online Seminar AWS Key Management Service (KMS) AWS Black Belt Online Seminar AWS Key Management Service (KMS)
AWS Black Belt Online Seminar AWS Key Management Service (KMS)
 
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
202110 AWS Black Belt Online Seminar AWS Site-to-Site VPN
 
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
20191029 AWS Black Belt Online Seminar Elastic Load Balancing (ELB)
 
20200630 AWS Black Belt Online Seminar Amazon Cognito
20200630 AWS Black Belt Online Seminar Amazon Cognito20200630 AWS Black Belt Online Seminar Amazon Cognito
20200630 AWS Black Belt Online Seminar Amazon Cognito
 
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
20191016 AWS Black Belt Online Seminar Amazon Route 53 Resolver
 
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190130 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
 
20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager20200212 AWS Black Belt Online Seminar AWS Systems Manager
20200212 AWS Black Belt Online Seminar AWS Systems Manager
 
20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説
20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説
20201118 AWS Black Belt Online Seminar 形で考えるサーバーレス設計 サーバーレスユースケースパターン解説
 
20200818 AWS Black Belt Online Seminar AWS Shield Advanced
20200818 AWS Black Belt Online Seminar AWS Shield Advanced20200818 AWS Black Belt Online Seminar AWS Shield Advanced
20200818 AWS Black Belt Online Seminar AWS Shield Advanced
 
20190919 よくご相談いただくセキュリティの質問と考え方
20190919 よくご相談いただくセキュリティの質問と考え方20190919 よくご相談いただくセキュリティの質問と考え方
20190919 よくご相談いただくセキュリティの質問と考え方
 
20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway 20190514 AWS Black Belt Online Seminar Amazon API Gateway
20190514 AWS Black Belt Online Seminar Amazon API Gateway
 
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
20190828 AWS Black Belt Online Seminar Amazon Aurora with PostgreSQL Compatib...
 
20190723 AWS Black Belt Online Seminar AWS CloudHSM
20190723 AWS Black Belt Online Seminar AWS CloudHSM 20190723 AWS Black Belt Online Seminar AWS CloudHSM
20190723 AWS Black Belt Online Seminar AWS CloudHSM
 
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
 
20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone
20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone
20191105 AWS Black Belt Online Seminar Amazon Route 53 Hosted Zone
 
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
202205 AWS Black Belt Online Seminar Amazon VPC IP Address Manager (IPAM)
 

Similar to 20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline

CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
Amazon Web Services
 
20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 

Similar to 20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline (20)

20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
20200804 AWS Black Belt Online Seminar Amazon CodeGuru
20200804 AWS Black Belt Online Seminar Amazon CodeGuru20200804 AWS Black Belt Online Seminar Amazon CodeGuru
20200804 AWS Black Belt Online Seminar Amazon CodeGuru
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
 
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
20200303 AWS Black Belt Online Seminar AWS Cloud Development Kit (CDK)
 
AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...
AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...
AWS SSA Webinar 34 - Getting started with databases on AWS - Managing DBs wit...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
AWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWSAWS Startup Garage - Building your MVP on AWS
AWS Startup Garage - Building your MVP on AWS
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCU
 
20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
 
Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2
 
CI/CD@Scale
CI/CD@ScaleCI/CD@Scale
CI/CD@Scale
 
Continuous Delivery Best Practices
Continuous Delivery Best PracticesContinuous Delivery Best Practices
Continuous Delivery Best Practices
 
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
Strumenti e servizi basici per sviluppatori, come iniziare a creare sul cloud...
 
CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...
 
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
 

More from Amazon Web Services Japan

More from Amazon Web Services Japan (20)

202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
202205 AWS Black Belt Online Seminar Amazon FSx for OpenZFS
 
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender202204 AWS Black Belt Online Seminar AWS IoT Device Defender
202204 AWS Black Belt Online Seminar AWS IoT Device Defender
 
Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022Infrastructure as Code (IaC) 談義 2022
Infrastructure as Code (IaC) 談義 2022
 
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
202204 AWS Black Belt Online Seminar Amazon Connect を活用したオンコール対応の実現
 
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
202204 AWS Black Belt Online Seminar Amazon Connect Salesforce連携(第1回 CTI Adap...
 
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデートAmazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
Amazon Game Tech Night #25 ゲーム業界向け機械学習最新状況アップデート
 
20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと20220409 AWS BLEA 開発にあたって検討したこと
20220409 AWS BLEA 開発にあたって検討したこと
 
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
202202 AWS Black Belt Online Seminar AWS Managed Rules for AWS WAF の活用
 
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
202203 AWS Black Belt Online Seminar Amazon Connect Tasks.pdf
 
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
SaaS テナント毎のコストを把握するための「AWS Application Cost Profiler」のご紹介
 
Amazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDDAmazon QuickSight の組み込み方法をちょっぴりDD
Amazon QuickSight の組み込み方法をちょっぴりDD
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
機密データとSaaSは共存しうるのか!?セキュリティー重視のユーザー層を取り込む為のネットワーク通信のアプローチ
 
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
パッケージソフトウェアを簡単にSaaS化!?既存の資産を使ったSaaS化手法のご紹介
 
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
202202 AWS Black Belt Online Seminar Amazon Connect Customer Profiles
 
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するためにAmazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
Amazon Game Tech Night #24 KPIダッシュボードを最速で用意するために
 
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
202202 AWS Black Belt Online Seminar AWS SaaS Boost で始めるSaaS開発⼊⾨
 
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
[20220126] JAWS-UG 2022初頭までに葬ったAWSアンチパターン大紹介
 
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
202111 AWS Black Belt Online Seminar AWSで構築するSmart Mirrorのご紹介
 
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
202201 AWS Black Belt Online Seminar Apache Spark Performnace Tuning for AWS ...
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

20201111 AWS Black Belt Online Seminar AWS CodeStar & AWS CodePipeline

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 公式 Webinar https://amzn.to/JPWebinar 過去資料 https://amzn.to/JPArchive © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeStar & AWS CodePipeline サービスカットシリーズ [AWS Black Belt Online Seminar] Solutions Architect 山口 弘樹 2020/11/11
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Black Belt Online Seminar とは 「サービス別」「ソリューション別」「業種別」のそれぞれのテーマに分かれて、アマゾ ン ウェブ サービス ジャパン株式会社が主催するオンラインセミナーシリーズです。 質問を投げることができます! • 書き込んだ質問は、主催者にしか見えません • 今後のロードマップに関するご質問は お答えできませんのでご了承下さい Twitter ハッシュタグは以下をご利用ください #awsblackbelt ① 吹き出しをクリック ② 質問を入力 ③ Sendをクリック
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 内容についての注意点 • 本資料では2020年11月11日時点のサービス内容および価格についてご説明しています。最新の情 報はAWS公式ウェブサイト(http://aws.amazon.com)にてご確認ください。 • 資料作成には十分注意しておりますが、資料内の価格とAWS公式ウェブサイト記載の価格に相違 があった場合、AWS公式ウェブサイトの価格を優先とさせていただきます。 • 価格は税抜表記となっています。日本居住者のお客様には別途消費税をご請求させていただきま す。 • AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.  名前 山口 弘樹(やまぐち ひろき)yamaghi@  所属 アマゾン ウェブ サービス ジャパン株式会社 パートナーソリューションアーキテクト  経歴 国内 SIer で主に PM / PL や上級 SE を担当 Spring Boot を使った MSA システム設計、アジャイル開発の推進  好きなAWSサービス AWS Code シリーズ 自己紹介
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本セミナーの概要 ❑ 本セミナーで学習できること ❖ AWS CodeStar、AWS CodePipelineの機能概要 ❖ CI/CD を構築する際の一般的な構成 ❑ 対象者 ❖ AWS CodeStar、AWS CodePipelineにご興味がある方 ❖ これから CI/CD を検討している方、または既にCI/CD を導入している方  定期的に機能拡充を行っているアプリケーションエンジニア、 または開発を支えるインフラエンジニア  機能拡充頻度は低いが CI/CD を通してプロセスの自動化を図りたい方
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 新たなマーケット 新たな顧客価値New economics 新たなデジタル製品とサービス 急速なイノベーションがビジネスを進化させる
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ListenIdeas アイデア Experiment Innovation Flywheel お客様の声 実験 実験がイノベーションを加速する
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ソフトウェア開発手法の潮流の変化 複雑で変化の激しい問題に対応し、可能な限り価値の高いプロダクトを 生産的かつ創造的に届けるための開発方法論が求められるようになった  スクラムやXPなどアジャイル型開発が浸透  デザイン思考などユーザーを理解し、 仮説立てて問題解決する設計手法 http://agilemanifesto.org/iso/ja/manifesto.html
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ソフトウェア開発のライフサイクル 1way:リードタイム短縮 2way:Feedbackを元に改善 3way:継続的な実験と学び AWS が考える DevOps
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 30x頻繁なデプロイ 440xリードタイムの短縮 60xミスが減少 -21%予期しない作業の削減 +44%新しい作業 https://puppet.com/resources/whitepaper/2017-state-of-devops-report CI/CDを利用して高品質な機能を迅速にリリースする CI/CDを自動化しているチームは コードをより速く、自信を持って書いている
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. • 他のシステムと の統合テスト • ロードテスト • UIテスト • 侵入テスト • ソースコードを チェックイン • バージョン管理、 ブランチ管理 • 新しいコードの ピアレビュー • Java、C#などの コードのコンパイル • ユニットテスト • スタイルチェッカー • コードメトリック • コンテナイメージの 作成 • 本番環境に デプロイ リリースプロセスに求められる 4 つのフェーズ Source Build Test Deploy
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. リリースプロセスのレベル Source Build Test Deploy 継続的インテグレーション (CI) 継続的デリバリ (CD) 継続的デプロイメント (CD) 承認してからリリース
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline CI/CD の実現を容易にするAWS Code サービス MONITORDEPLOYTESTBUILD SOURCE / ARTIFACT AUTHOR AWS CodeBuild + Third Party AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS X-Ray AWS Cloud9 AW IDE Toolkits Amazon CloudWatch AWS CodeArtifact Amazon CodeGuru AWS CodeStar
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS を活用した CI/CD の特徴 低コストと 無料利用枠 承認アクションと ステージ移行 任意のアクションは コードベースで定義可能 AWSサービスとの シームレスな連携 マネージドサービスによる 高い可用性と信頼性 サードパーティーツールとの インテグレーション
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeStar の概要  AWS上での開発をわずか数分間で開始  チームをまたがった開発をセキュアに  ソフトウェア デリバリーの管理を容易に  様々なプロジェクトテンプレートから選択
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 豊富なプロジェクトテンプレート プロジェクトテンプレートを選ぶと CI/CD 環境が自動で作成される (※テンプレートの一部のみ記載)
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. プロジェクト ダッシュボード ダッシュボードを通して、リポジトリやパイプラインが可視化 App エンドポイント CloudWatch メトリクス Repository エンドポイント 開発ツール との連携 デリバリー パイプライン 統合メニュー
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. パイプラインの自動生成 ステージとして、ソース・ビルド・デプロイが構築される Source Build Deploy
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 開発ツールとの連携 開発ツールとして AWS Cloud9 も同時にデプロイできる
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. セットアップ内容 • プロジェクトテンプレートの選択 • EC2 or Beanstalk or Lambda • プロジェクトの設定 • リポジトリ(CodeCommit、GitHub) • プロジェクトの編集 • プロジェクトダッシュボード • CodePipeline 継続的デプロイメントパイプライン • CloudWatchメトリクス
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeStar の操作: プロジェクトを作成 1. テンプレートからサンプルプロジェクトを選択 2. プロジェクト名、リポジトリ情報などを入力し、あとは数分間待つだけ
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeStar の操作: チームメンバを追加・削除 • 既存のチームメンバー、またはIAMユーザーからユーザーの追加が可能 • 表示名、メールアドレス、ロールを指定して簡易にプロジェクトメンバーを作成できる
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodeStar の料金 AWS CodeStar に対する追加料金は発生しません • CodeStar プロジェクトでプロビジョニングされた AWS リソース (例: Amazon EC2 インスタンス、AWS Lambda の実行、Amazon EBS ボ リューム、Amazon S3 バケット) に対してのみ料金が発生します。 https://aws.amazon.com/jp/codestar/pricing/
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline 概要  素早く信頼性の高いアプリケーション更新のため の継続的デリバリーサービスを提供  ソフトウェアリリースプロセスをモデル化する ことにより視覚化  コードが変更されるとコードのビルド、テスト、 デプロイを実施  AWSサービスやサードパーティーのツールと統合
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ソースコード ビルド ユニット テスト ステージ デプロイ 本番 デプロイ A機能画面 テスト CodePipeline ステージ デプロイ B機能画面 テスト 開発のスタイルに合ったパイプラインを自在に構築 パイプラインは開発チームやサービスにより異なる スムーズなデプロイメントにはパイプラインは欠かせない
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の定義 MyApp CodeCommit Source Build CodeBuild Build DeployToInteg CodeDeploy Integration IntegTest End2EndTester DeployToProd CodeDeploy Production ソース ビルド 検証環境 デプロイ テスト実行 本番環境 デプロイ アクション ステージ パイプライン トランジション 入力アーティファクト 出力アーティファクト
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの作成 • パイプライン名を指定する • 任意のサービスロールを指定する • 高度な設定(アーティファクトストア、 暗号化キー)はオプション https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの作成 • ソースプロバイダーを指定する • ソースプロバイダーに紐づく情報を 指定する(例: AWS CodeCommitのリ ポジトリ名やブランチ名) https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの作成 • ビルドステージはオプショナル (コンパイル言語の場合は指定) • ビルドプロバイダーを指定する • ビルドプロバイダーに紐づく情報を 指定する(例: リージョン、アプリ ケーション名など) https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 34. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの作成 • デプロイステージはオプショナル (CDを行う場合は指定) • デプロイプロバイダーを指定する • デプロイプロバイダーに紐づく情報を 指定する(例: リージョン、アプリ ケーション名など) https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 35. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの作成 .. • パイプライン構成を確認し、 作成を選択 https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 36. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの編集 .. • パイプラインの編集で、作成したステー ジやアクションを編集可能 • 後からアクションやステージを追加可能 https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create.html
  • 37. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの実行開始、停止 • パイプラインの開始・停止が可能。 • リリースに問題が含まれていることに 気付いた場合、それ以上のデプロイから リリースをすぐに停止可能に。 https://aws.amazon.com/jp/about-aws/whats-new/2020/01/aws-codepipeline-enables-stopping-pipeline-executions/
  • 38. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの実行履歴を表示 • パイプラインで最後に実行されたアク ション、ステージ間のトランジション、 失敗した結果など、詳細を表示する • 実行履歴は最大12ヶ月間保存
  • 39. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CodePipeline の操作: パイプラインの実行結果の通知 • リポジトリ、ビルドプロジェクト、デプ ロイ、およびパイプラインのイベントに 関する通知を送信する • 通知はAmazon SNSで送信される https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome.html
  • 40. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 参考資料: ビルドやテスト結果をSlack等に通知する https://aws.amazon.com/jp/blogs/news/receive-aws-developer-tools-notifications-over-slack-using-aws-chatbot/
  • 41. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 参考資料: ビルドやテスト結果をSlack等に通知する  AWS Chatbot を利用して AWS 開発者用ツールの通知を Slack で受け取る方法 https://aws.amazon.com/jp/blogs/news/receive-aws-developer-tools- notifications-over-slack-using-aws-chatbot/  ウェブフックを使用して Amazon SNS メッセージを Amazon Chime、Slack や Microsoft Teams に発行する方法を教えてください。 https://aws.amazon.com/jp/premiumsupport/knowledge-center/sns-lambda- webhooks-chime-slack-teams/
  • 42. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline がサポートしているプロバイダー ・Source ₋ AWS CodeCommit ₋ Amazon ECR ₋ Amazon S3 ₋ Bitbucket ₋ GitHub ₋ GitHub Enterprise Server ・Build ₋ AWS CodeBuild ₋ CloudBees ₋ Jenkins ₋ TeamCity ・Test ₋ AWS CodeBuild ₋ AWS Device Farm ₋ BlazeMeter ₋ Jenkins ₋ GhostInspector ₋ Micro Focus StormRunner Load ₋ Nouvola ₋ Runscope https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/integrations-action-type.html https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
  • 43. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline がサポートしているプロバイダー ・Deploy ₋ AWS CodeDeploy ₋ AWS CloudFormation ₋ Amazon S3 ₋ Amazon ECS ₋ Amazon ECS (Blue/Green) ₋ Elastic Beanstalk ₋ AWS AppConfig ₋ AWS OpsWorks ₋ AWS Service Catalog ₋ Amazon Alexa ₋ XebiaLabs ・Approval ₋ Manual ・Invoke ₋ AWS Lambda ₋ AWS Step Functions https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/integrations-action-type.html https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
  • 44. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline と統合可能な製品 Source Build Test Deploy https://aws.amazon.com/jp/codepipeline/product-integrations/
  • 45. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Custom アクション デフォルトで用意されていない独自のアクションを追加可能 AWS CLI を使ってパイプラインにカスタムアクションを作成 Job Worker の作成が必要 • Customアクションに対するAWS CodePipelineのジョブリクエストを ポーリング • Custom Jobの実行 • 結果のステータスをAWS CodePipelineに返す • AWS CodePipelineから参照可能なパブリックなエンドポイントを公開 http://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/actions-create-custom-action.html
  • 46. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Custom アクション 開発者が コミット カスタムアクションリソース カスタムビルドアクション 1. エージェントでポーリング 2. ジョブの詳細 4. ビルドの実行 5. ジョブの成功 カスタムジョブワーカー 3. ジョブのAck Amazon S3AWS CodePipeline
  • 47. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda ファンクションの実行 AWS CodePipeline のアクションとして Lambda を呼び出し可能 Lamdba ファンクションの利用例: • AWS CloudFormation を使用して、任意のタイミングでリソース作成・削除 • Lambda ファンクション で CNAME をスワップすることでゼロダウンタイムでの バージョンアップを ElasticBeanstalk で実行 • AMI スナップショットを作成することで構築、デプロイする前にリソースの バックアップを作成 • IRC クライアントにメッセージをポストするなど、サードパーティーの製品と統合 https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Lambda.html
  • 48. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Step Function の実行 AWS CodePipelineのアクションとして AWS Step Function を呼び出し可能 リリースプロセスの一部として複雑なワークフローを呼び出すことができる AWS Step Function の利用例: • 条件付き分岐、エラー処理、および非同期タスクを行う処理 • 他の AWS のサービスとの連携 • シンプルなリリースパイプラインを維持し、複雑なワークフローの動作を Step Functions ステートマシンエンジンに委任する https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-StepFunctions.html
  • 49. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Approval アクション ・パイプラインに承認アクションを追加し承認されたら次のステージへ ・SNS トピックをあわせて指定することでメールで通知 ・承認アクションの例 • リビジョンが次のステージに進む前にコードレビュや変更管理レビューを依頼 • 手動の品質管理テストを最新バージョンのアプリケーションに実施を依頼 • リリース前にビルドされた成果物の統合確認を依頼
  • 50. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 並列アクションと逐次アクション Source Source GitHub Build JenkinsOnEC2 Jenkins Deploy JavaApp Elastic Beanstalk NotifyDevelopers Lambda MyApplication 並列アクション Source Source GitHub Build JenkinsOnEC2 Jenkins Deploy JavaApp Elastic Beanstalk NotifyDevelopers Lambda TestAPI Runscope MyApplication 逐次アクション
  • 51. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 実行時のアクション間の変数引き渡し パイプライン内でアクション間の変数受け渡しが可能に。 従来はアクション間で受け渡しは出来なかったが、変数を元に評価をすることで、 よりダイナミックなアクションが記述可能となった。 利用例: • CodeCommit ソースアクションが出力するコミットメッセージを元に、 手動認証操作のためのカスタムメッセージを定義する • エンドポイント URL の生成をデプロイステージで行い、 その後に続くテストアクションでテストする • カスタムワークフローにおいては、Lambda アクションが出力する変数を、 それに呼応するアクションで自由に使用できる https://aws.amazon.com/jp/about-aws/whats-new/2019/11/aws-codepipeline-enables-passing-variables-between-actions-at- execution-time/
  • 52. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Source XXX CodeCommit Build XXX CodeBuild Deploy XXX Amazon ECS ソースアーティファクト ビルドアーティファクト 4. ソースアーティファクト を取得 1. 変更を取得 5. ビルドアーティファクト を格納 3. ビルドを実行 6. 成功を通知 7. CodePipelineでイメージを更新 MyApplication AWS CodeCommit Amazon ECS Amazon ECR AWS CodeBuild 構成例: Amazon ECS での CI/CD パイプライン Amazon S3 8. ビルドアーティ ファクトを取得
  • 53. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 8. ビルドアーティ ファクトを取得 Source XXX CodeCommit Build XXX CodeBuild Deploy XXX CodeFormation 4. ソースアーティファクトを取得 1. 変更を取得 5. ビルドアーティファクトを格納 3. ビルドを実行 6. 成功を通知 7. CloudFormationで環境を構築 MyApplication AWS CodeCommit AWS CloudFormation AWS CodeBuild 構成例: サーバーレス での CI/CD パイプライン Amazon S3 9. 展開 Amazon DynamoDB AWS Lambda Amazo API Gateway ビルドアーティファクト ソースアーティファクト
  • 54. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Source XXX CodeCommit Build XXX CodeBuild Deploy XXX Beanstalk 1. 変更を取得 3. ジョブをポーリング 4. ジョブを承認 7. 成功を通知 MyApplication GitHub 構成例: GitHub, Jenkins との連携 Amazon S3Jenkin Javaアプリ 5. ソースアーティファクトを取得 6. ビルドアーティファクトを格納 ビルドアーティファクト ソースアーティファクト 8. AWS Elastic Beanstalkで環 境を構築 AWS Elastic Beanstalk 10. 展開 9. ビルドアーティ ファクトを取得
  • 55. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline のクォータ https://docs.aws.amazon.com/ja_jp/codepipeline/latest/userguide/limits.html Resource デフォルト値 アクションがタイムアウトするまでの 時間 Approvalアクション: 7 日間 AWS CloudFormation デプロイアクション: 3 日間 CodeBuild ビルドアクションおよびテストアクション: 8 時間 CodeDeploy および CodeDeploy ECS (blue/green) デプロイアクション: 5 日 間 AWS Lambda の呼び出しアクション: 24 時間 AWS アカウントのリージョンあたりの 全パイプラインの最大数 300 AWS リージョンごとにソース変更の ポーリングに設定するパイプラインの 最大数 60 AWS アカウントのリージョンあたりの ウェブフックの最大数 300 AWS アカウントのリージョンあたりの カスタムアクションの数 50
  • 56. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS CodePipeline の料金 アクティブパイプライン* 1つに対して、1.00 USD / 月 • 実験を奨励するため、パイプラインは作成後の最初の 30 日間は無料 • アクティブパイプライン*とは、30日以上存在していて、 その月に1つのコード変更が発生したパイプライン • その月に新しいコード変更がないパイプラインに対しては 料金は発生しません • 1ヶ月に満たない分に対しては按分計算されません 無料利用枠 • アクティブなパイプラインを1か月あたり1つ無料 https://aws.amazon.com/jp/codepipeline/pricing/
  • 57. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 58. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. インターネットを経由せずにパイプラインを作るには? AWS CodePipeline AWS CodeDeploy Amazon Route 53 Direct Connect Amazon EC2 AWS CodeBuild AWS CodeCommit クライアント端末 VPC エンドポイントを経由するとインターネットにアクセスすることなくサービスと連携が可能。 AWS CodeCommit、AWS CodeBuild、AWS CodeDeploy は VPC エンドポイントに対応している。 クライアント端末から VPC エンドポイント経由で AWS CodeCommit にコミットする。 AWS CodePipeline 内はAWSサービス間のため閉域網で連携する。
  • 59. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 開発・検証・本番のパイプラインをどう作れば良いか? https://aws.amazon.com/jp/blogs/devops/implementing-gitflow-using-aws-codepipeline-aws-codecommit-aws- codebuild-and-aws-codedeploy/ 基本的には、ブランチ毎にパイプラインを分けて構築する。 環境別の差分は環境変数として定義し、CodePipelineから設定する。 master hotfix release develop V0.1 feature V1.0 AWS CodePipeline AWS CodeCommit AWS CodeBuild AWS CodeDeploy
  • 60. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 参考資料: AWS Developer Tools を活用した Git-flow https://gitflow-codetools.workshop.aws/https://d1.awsstatic.com/events/reinvent/2019/REPEAT_2_I mplementing_GitFLow_with_AWS_tools_DOP202-R2.pdf
  • 61. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. クロスアカウントでパイプラインを作るには? https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create-cross-account.html https://aws.amazon.com/jp/blogs/devops/aws-building-a-secure-cross-account-continuous-delivery-pipeline/ Amazon EC2AWS CodeCommit codecommit- service-role Amazon S3 AWS CodePipeline AWS CodeDeployAWS CodeBuild Assume Role Assume Role でアクセス権限を委任することで連携が可能。 注意点として、アカウントを跨いでアーティファクトを受け渡すため、S3バケットならびにAWS KMSキーをク ロスアカウントアクセスを有効にする必要がある。またクロスアカウントパイプラインの制限内でアクセスでき るように構成を組む必要がある。 AWSCodePipeline ServiceRole codebuild- service-role codedeploy- service-role AWS KMS
  • 62. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. https://cross-account-cicd-pipeline.workshop.aws/ 参考資料: Cross-Account CI/CDパイプライン ワークショップ
  • 63. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 本日のアジェンダ • CI/CD が必要となる背景 • AWS CodeStar の機能説明 • AWS CodePipeline の機能説明 • よくあるご相談 • まとめ
  • 64. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. まとめ • AWS CodeStar は、テンプレートベースで CI/CD 環境を素早く構築でき、 ダッシュボードで一元管理できる。CI/CD 環境を試してみたい方はオススメ。 • AWS CodePipeline は、リリースプロセス全体を一貫したやり方で完全に自動 化できる。AWS が揃えているソース、ビルド、デプロイのサービス群とでき るほか、サードパーティー製品とも連携ができる。 • 急速なビジネススピードに応えるためには、CI/CDは必須。 これらサービスを活用することで高品質なソフトウェアをインクリメンタル な開発手法で素早くリリース!
  • 65. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Q&A お答えできなかったご質問については AWS Japan Blog 「https://aws.amazon.com/jp/blogs/news/」にて 後日掲載します。
  • 66. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS の日本語資料の場所「AWS 資料」で検索 https://amzn.to/JPArchive 67
  • 67. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 毎週” 個別技術相談会”を実施中 • のソリューションアーキテクト に 対策などを相談することも可能 • 申込みはイベント告知サイトから (https://aws.amazon.com/jp/about-aws/events/) AWS Well-Architected 個別技術相談会 68
  • 68. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 公式 Webinar https://amzn.to/JPWebinar 過去資料 https://amzn.to/JPArchive © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ご視聴ありがとうございました