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
Transcript
24 slides
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通知を送れる機能を作ってください
More Decks by youta ogino
See All by youta ogino
【CNDT2020】Amebaアフィリエイト基盤の GKEアーキテクチャと マイクロサービス
youta1119
2
1.4k
KotlinFest2019
youta1119
4
13k
Other Decks in Programming
See All in Programming
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
250
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
750
Railsバージョンを4倍にした話
optim
0
1k
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
300
Spec-driven Development with AI
simas
PRO
0
2.3k
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
170
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.1k
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
230
protojson における文字化けの扱い
kazuki1023
0
400
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
11k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Designing for Performance
lara
612
70k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.3k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.8k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Six Lessons from altMBA
skipperchong
29
4.6k
Balancing Empowerment & Direction
lara
6
1.4k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
470
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Chasing Engaging Ingredients in Design
codingconduct
0
390