Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Amplify Console のビルド通知をSlackで受け取るためにやったこと
Search
youta ogino
July 31, 2020
Programming
5.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Amplify Console のビルド通知をSlackで受け取るためにやったこと
2020/07/31 Amplify Meetup#01の登壇内容
youta ogino
July 31, 2020
More Decks by youta ogino
See All by youta ogino
【CNDT2020】Amebaアフィリエイト基盤の GKEアーキテクチャと マイクロサービス
youta1119
2
1.3k
KotlinFest2019
youta1119
4
13k
Other Decks in Programming
See All in Programming
Workers Cache を知る
syumai
0
320
setup-vp GitLab対応の裏側
naokihaba
0
140
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
9.2k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
1
1.1k
Are APIs Still Relevant in the AI Era?
soyuka
0
380
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
19
20k
mrbgem 三角測量 開発
ogom
0
160
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
580
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
740
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
550
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Code Reviewing Like a Champion
maltzj
528
40k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
480
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
Transcript
Amplify Console のビルド通知を Slackで受け取るためにやったこ と 2020/07/31 Amplify Meetup#01
自己紹介 • 荻野 陽太 • バックエンドエンジニア • 株式会社justInCaseTechnologies(副業) • twitter/github
@youta1119
会社紹介的なやつ 書きたいこと募集 SRE/バックエンド 絶賛募集中!!!
これ、全部Amplify Consoleです
justInCaseにおけるAmplify Console導入状況 • ほぼ全てのプロダクトで導入済み • dev環境だけで10以上のアプリがある • 基本的にアプリはcfnかcdkで管理している
ビルド完了したらSlackに通知を飛ばしたい! ある日ビルド完了したらSlackにビルド結果の通知が欲しいという要望が... → 現状のAmplifyにはそういう機能なかった... amplify.ymlのpostBuild内で通知を送る手もあるがこれだと、ビルドの前に失 敗すると通知送れない...
ビルド完了したらSlackに通知を飛ばしたい! 参考: https://qiita.com/fossamagna/items/70e4e399de59984ad3bb 1.メール通知を設定 2.SNS Topicが出来る 3. Lambdaで購読
ビルド完了したらSlackに通知を飛ばしたい!
None
None
Slackに通知を飛ばせるようになった! ソースコードはこちら https://gist.github.com/youta1119/fc6a6d3b769b2fc54d33db67ba4c4ed5
これでSlackに通知を送れるようになったが... • CloudFormationではメール通知の設定ができない • 手作業でメール通知の設定をしないといけない • SNSのARNは送られてくるメールを見ないとわからないので自動化できな い... 既に10個以上アプリがあるので手動で設定するのはつらい →なんとか自動化したい...
他に何かよい方法がないものか • Amplify ConsoleのIssueに気になるコメントを発見 • https://github.com/aws-amplify/amplify-console/issues/13#issueco mment-603459099 .
他に何かよい方法がないものか 意訳: • Amplifyが作成するEventBridgeのイベントパターンを変更して、すべてのブランチ(過去、現 在、未来)についてメールに通知できるよ。 • EventBridgeのWebコンソールに移動して「 amplify-xxxx-xxxx-branch-notification」の形式を 見つけて、ルールのイベントパターンを編集してね EventBridge…AWS環境で発生するイベントを、
AWSサービスやSaaSのサービスと紐付けることがで きるサービス
None
他に何かよい方法がないものか AmplifyConsoleが自動で作成するEventBridgeのRuleと同じRuleを自分で作 ればビルドイベントが受け取れるのでは? →やってみた
ビルドイベントを受け取るRuleを作ってみる ここにビルドイベントを受け取る 用のイベントパターンを記述
ビルドイベントを受け取るRuleを作ってみる ビルドイベントを受け取りたいアプリのappIdを指定 1. ビルドイベントを受け取りたいアプリのappIdを指定 2. ビルドイベントを受け取りたいブランチを指定(何も指定しな い場合全てのブランチのビルドイベントを受け取れる) 補足)Amplify AppのAppIdは aws
amplify list-appsを実行すれば分かる
ビルドイベントを受け取るRuleを作ってみる 適当なSNSのトピックを指定 SNSに転送するイベントの整形 amplifyが自動で作るinput transformerの設定 をコピペしたものそ設定
Rule作成時の注意点 • DefaultのEventBusに作らないといけない
ビルドイベントを受け取るRuleを作ってみる
Slackに通知の設定を自動化できた!
まとめ Amplify Console のビルド通知をSlackで受け取りたい場合... 1. EventBridgeでAmplifyのビルドイベントを受け取ってSNSに転送するルー ルを作る 2. LambdaでSNSを購読してSlackに通知を送る
最後に • AWSさん、Amplify ConsoleからSlack通知を送れる機能を作ってください