Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon EventBridgeでできることをまとめてみた #devio2021
Search
ynishimura
October 05, 2021
Technology
0
11k
Amazon EventBridgeでできることをまとめてみた #devio2021
DevelopersIO Decadeでビデオ登壇するにあたり作成した資料になります。
ynishimura
October 05, 2021
Tweet
Share
More Decks by ynishimura
See All by ynishimura
React + Tauriでデスクトップアプリ開発に入門してみた
ynishimura0922
0
220
Amazon EventBridgeを使って簡単なAWS環境の監視システムを構築する #devio2022
ynishimura0922
1
5.2k
Other Decks in Technology
See All in Technology
リクルートのデータ基盤 Crois 年3倍成長!1日40,000コンテナの実行を支える AWS 活用とプラットフォームエンジニアリング
recruitengineers
PRO
1
230
同一クラスタ上でのFluxCDとArgoCDのリソース最適化の話
kumorn5s
0
150
Nihonbashi Test Talk #3_WebDriver BiDiと最新の実装状況 / WebDriver BiDi latest status
takeyaqa
1
160
GeminiとUnityで実現するインタラクティブアート
hokkey621
0
650
開発者向けツールを魔改造してセキュリティ診断ツールを作っている話 - 第1回 セキュリティ若手の会 LT
pizzacat83
0
400
開志専門職大学特別講義 2024 オープニング
1ftseabass
PRO
0
230
JAWS-UG 横浜支部 #76 AWS re:Invent 2024 宇宙一早い Recap LT3Amazon EKS Auto Modeと遊び(パーティ)の話
tjotjo
0
140
開志専門職大学特別講義 2024 デモパート
1ftseabass
PRO
0
210
[GDG DevFest Bangkok 2024] - The Future of Retail E-commerce with Gemini AI
punsiriboo
0
300
2024/12/05 AITuber本著者によるAIキャラクター入門 - AITuberの基礎からソフトウェア設計、失敗談まで
sr2mg4
2
590
PR TIMESにおけるNext.jsとcacheの付き合い方
apple_yagi
2
270
【全貌公開】 MIXI の Atlassian Cloud 移行の裏側 / Behind MIXI's Migration to Atlassian Cloud
mixi_engineers
PRO
0
120
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Facilitating Awesome Meetings
lara
50
6.1k
Writing Fast Ruby
sferik
627
61k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Typedesign – Prime Four
hannesfritz
40
2.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
27
2.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Transcript
ΦϖϨʔγϣϯ෦ଜ༞ೋ "NB[PO&WFOU#SJEHFͰ Ͱ͖Δ͜ͱΛ·ͱΊͯΈͨ
ଜ༞ೋ "84ࣄۀຊ෦ΦϖϨʔγϣϯ෦ େࡕΦϑΟεࡏ੶ αʔόʔϨεڥߏங ࣗݾհ - 2021 APN AWS
Top Engineer/ APN ALL AWS Certi fi cations Engineer - 2020 APN AWS Top Engineers - 2019 APN AWS Top Engineers
࣍ w"NB[PO&WFOU#SJEHFʹ͍ͭͯ w"NB[PO&WFOU#SJEHFͷશମ૾ɾߏ w"NB[PO&WFOU#SJEHFͷศརͳػೳ ˞࣌ͷใ
ࠓճ͞ͳ͍͜ͱ wΠϕϯτۦಈΞʔΩςΫνϟͷઃܭʹ͍ͭͯ wϚΠΫϩαʔϏεͷઃܭʹ͍ͭͯ wࣅͨ͜ͱ͕Ͱ͖ΔଞαʔϏεͱͷҧ͍ɾબఆʹ͍ͭͯ
ఆࢹௌऀ w4BB4ෳͷαʔϏεΛ࿈ܞͨ͠γεςϜΛߏங͍ͨ͠ w"NB[PO&WFOU#SJEHFΛ͍͖͍ͬͯͨ w"NB[PO&WFOU#SJEHFʹ͍ͭͯΓ͍ͨ ΰʔϧ w"NB[PO&WFOU#SJEHFͰͰ͖Δ͜ͱɺ֓ཁΛཧղ
Amazon EventBridgeͱ
"NB[PO&WFOU#SJEHFͱ l"84ɺطଘͷγεςϜɺ·ͨ4BB4ΞϓϦશମͰ ΠϕϯτۦಈܕΞϓϦέʔγϣϯΛେنʹߏங͢Δz https://aws.amazon.com/jp/eventbridge/
"NB[PO&WFOU#SJEHFͱ l"84ɺطଘͷγεςϜɺ·ͨ4BB4ΞϓϦશମͰ ΠϕϯτۦಈܕΞϓϦέʔγϣϯΛେنʹߏங͢Δz https://aws.amazon.com/jp/eventbridge/ ʰΠϕϯτʱΛ༻͍༷ͯʑͳΞϓϦέʔγϣϯΛ ؆୯ʹଓͰ͖ΔΑ͏ʹ͢ΔϧʔςΟϯάαʔϏε
Πϝʔδ ಠࣗ"QQ 4BB4 "84αʔϏε Amazon EventBridge Πϕϯτ ϧʔϧ Πϕϯτιʔε
λʔήοτ ϧʔϧ ϧʔϧ 4BB4 "84αʔϏε ผ"84ڥ Πϕϯτόεʴϧʔϧ Πϕϯτ
"NB[PO&WFOU#SJEHFΛར༻ͨ͠ྫ ૄ݁߹ʹϚΠΫϩαʔϏεΛΈཱͯΔ αʔόʔϨεͳϚωʔδυαʔϏεͷͨΊ αʔό४උɾߏஙɾཧ ʢϚϧν";ɺ4-"ˋʣ
Amazon EventBridgeͷશମ૾ɾߏ
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
Πϕϯτͱ Πϕϯτঢ়ଶมԽΛද͢ +40/ͰΓऔΓ +40/ߏ wEFUBJMUZQFΠϕϯτͷछྨ wTPVSDFΠϕϯτͷૹ৴ݩ wSFTPVSDFTؔ࿈Ϧιʔεͷྻ wEFUBJMΠϕϯτͷৄࡉσʔλ {
"version": "0" , "id": "6a7e8feb-b491-4cf7-a9f1-bf3 , "detail-type": "EC2 Instance State , "source": "aws.ec2" , "account": "111122223333" , "time": "2017-12-22T18:43:48Z" , "region": "us-west-1" , "resources": [ "arn:aws:ec2:us-west-1:123456789 ] , "detail": { "instance-id": "i-1234567890abcd , "state": "terminated" } }
Πϕϯτιʔε
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
Πϕϯτιʔε छྨ Πϕϯτͷछྨ ૹ৴ݩ ૹ৴ઌͷΠϕϯτόε ૹ৴͞ΕΔλΠϛϯά "84αʔϏεͷΠϕϯτ ֤"84αʔϏε σϑΥϧτͷ
Πϕϯτόε "84αʔϏεͷঢ়ଶ͕ม Θͬͨͱ͖ ֤"84αʔϏε $MPVE5SBJMܦ༝ "84αʔϏεͷ"1*Λݺͼ ग़ͨ͠ͱ͖ ΧελϜΠϕϯτ ΞϓϦέʔγϣϯ ૹ৴࣌ʹࢦఆ &WFOU#SJEHFͷ1VU&WFOUT "1*Λݺͼग़ͨ͠ͱ͖ 4BB4Πϕϯτ 4BB4ΞϓϦέʔγϣϯ ֤4BB4͝ͱʹ࡞͞ΕΔ ύʔτφʔΠϕϯτόε 4BB4ΞϓϦέʔγϣϯʹ ΑͬͯҟͳΔ
"84αʔϏε͕ૹ৴͢ΔΠϕϯτ w&WFOU#SJEHFະαϙʔτͷ߹$MPVE5SBJMܦ༝ͷΠϕϯτ औಘՄೳ wσϑΥϧτΠϕϯτόεʹૹ৴ https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-service-event.html &WFOU#SJEHFʹૹ৴͞ΕΔΠϕϯτ "84Ϧιʔεͷঢ়ଶมԽΛىʹΠϕϯτൃੜ $MPVE5SBJMܦ༝Ͱૹ৴͞ΕΔΠϕϯτ "84Ϧιʔεૢ࡞ʢ"1*ݺͼग़͠ʣΛىʹΠϕϯτൃੜ
Քಇத㱺ఀࢭ Ϣʔβͷૢ࡞Πϕϯτ Πϯελϯεͷঢ়ଶมԽ
ΧελϜΠϕϯτ w1VU&WFOUT"1*ݺͼग़͠ʹΑͬͯૹ৴ w$-*ͰBXTFWFOUTQVUFWFOUTίϚϯυͰૹ৴ w֤ݴޠͷ"844%,Λར༻࣮͠ wૹ৴ઌͷΠϕϯτόεૹ৴࣌ʹࢦఆՄೳ wະࢦఆͷ߹σϑΥϧτΠϕϯτόεʹૹ৴͞ΕΔ https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-putevents.html
ΧελϜΠϕϯτ 1ZUIPOΛͬͨΧελϜΠϕϯτΛൃߦ͢Δαϯϓϧ https://dev.classmethod.jp/articles/eventbridge-cross-account-schema-discovery/
4BB4Πϕϯτ w4BB4ʹΑΔΠϕϯτ֤4BB4ઐ༻ͷΠϕϯτόεʹૹ৴ wૹ৴͞ΕΔΠϕϯτͷछྨλΠϛϯάɺ֤4BB4ΞϓϦ έʔγϣϯͰҟͳΔ wଟ͘ͷ4BB4͕&WFOU#SJEHFʹ౷߹͞Ε͍ͯΔ https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-saas.html https://aws.amazon.com/eventbridge/integrations/
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/shopify-with-eventbridge/
Πϕϯτόε
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
Πϕϯτόεͷछྨ σϑΥϧτόε ΧελϜόε ύʔτφʔόε ྫʣΠϯελϯε͕ఀࢭͨ͠ ྫʣจػೳ͕จΛड͚͚ͨ ྫʣSaaSͰཧ͢Δސ٬ใ͕ ߋ৽͞Εͨ
ϧʔϧ
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
ϧʔϧ wΠϕϯτόεͰड৴ͨ͠ΠϕϯτͰɺͲͷΠϕϯτΛɹɹ λʔήοτʹૹ৴͢Δ͔Λఆٛ͢Δ Πϕϯτύλʔϯ τϥϯεϑΥʔϚʔ λʔήοτ ύλʔϯϚονϯάʹΑΔఆٛ εέδϡʔϧࣜʹΑΔఆٛ JSON
pathΛ༻ͯ͠ ΠϕϯτΛม λʔήοτϦετ ϧʔϧ͝ͱʹ࠷େ̑ݸࢦఆՄೳ Πϕϯτ
Πϕϯτύλʔϯ wύλʔϯϚονϯάʹΑΔΠϕϯτͷϑΟϧλʔ wϑΟϧλʔछྨɿɺϓϨϑΟοΫεɺଘࡏνΣοΫͳͲ { "source": ["aws.ec2"] , "detail-type": ["EC2
Instance State-change Notification"] , "detail": { "state": ["terminated" ] } } https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-event-patterns-content-based- fi ltering.html ྫʣEC2Πϯελϯεͷऴྃʹ͍ͭͯ௨Λड͚͍ͨΠϕϯτύλʔϯྫ
Πϕϯτύλʔϯ wεέδϡʔϧࣜʹΑΔΠϕϯτ࡞ wλΠϜκʔϯ65$ɺ࠷খਫ਼ʮʯ DSPOࣜ SBUFࣜ ઃఆͷܗࣜ DSPO <><࣌ؒ><><݄><༵><> SBUFT
<><୯Ґ> ઃఆྫ ຖޕޙ࣌ 65$ ʹ࣮ߦ͢Δ DSPO ͝ͱʹ࣮ߦ͢Δ SBUF NJOVUFT
τϥϯεϑΥʔϚʔ wೖྗΠϕϯτΛ+40/QBUIͰม https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-transform-target-input.html ड͚औͬͨΠϕϯτ ૹ৴Πϕϯτఆٛ มఆٛ { "instance" :
<instance> , "state": <state > } { "version": "0" , "id": "7bf73129-1428-4cd3-a780-95db273d1602" , "detail-type": "EC2 Instance State-change Notification" , "source": "aws.ec2" , "account": "123456789012" , "time": "2015-11-11T21:29:54Z" , "region": "us-east-1" , "resources": [ "arn:aws:ec2:us-east-1:123456789012:instance/i-abcd1111" ] , "detail": { "instance-id": "i-0123456789" , "state": "RUNNING" } } { "instance" : "$.detail.instance-id", "state" : "$.detail.state" } ೖྗͷInstance-id,state Λมʹࢦఆ มΛͬͯ λʔήοτʹૹ৴͢Δ ΠϕϯτΛఆٛ ྫʣEC2ͷঢ়ଶมԽͷΠϕϯτ
ૹ৴ઌλʔήοτ
"NB[PO&WFOU#SJEHFͷશମ૾ https://aws.amazon.com/jp/eventbridge/
λʔήοτ wΠϕϯτͷૹ৴ઌͱͳΓɺΠϕϯτΛॲཧ͢Δͷ wͭͷϧʔϧ͋ͨΓͭ·Ͱͷλʔήοτʹૹ৴Մೳ wϦτϥΠઃఆɺ%-2ͷઃఆՄೳ wΠϕϯτอ࣋ظؒɿ࠷େ࣌ؒ wϦτϥΠճɿ࠷େճ
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/eventbridge-supports- dead-letter-queue/
λʔήοτʹࢦఆͰ͖Δͷ wαϙʔτ͞Εͨ"84αʔϏε w"1*%FTUJOBUJPOʢ"1*Ѽઌʣ wผΞΧϯτͷΠϕϯτόε wผϦʔδϣϯͷΠϕϯτόε https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-targets.html
λʔήοτʹࢦఆͰ͖Δͷ wαϙʔτ͞Εͨ"84αʔϏε w"1*%FTUJOBUJPOʢ"1*Ѽઌʣ wผΞΧϯτͷΠϕϯτόε wผϦʔδϣϯͷΠϕϯτόε https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-targets.html
"1*%FTUJOBUJPOʢ"1*Ѽઌʣ wҙͷΤϯυϙΠϯτʹ )551ϦΫΤετΛૹ৴ wίʔυͷ࣮ෆཁ wηΩϡΞʹೝূใཧ wݺͼग़͠ϨʔτௐՄೳ https://aws.amazon.com/blogs/compute/using-api-destinations-with-amazon-eventbridge/ ਤͷҾ༻ݩ
"1*%FTUJOBUJPOʢ"1*Ѽઌʣͷೝূ wछྨͷೝূํ๏Λαϙʔτ w#BTJDೝূ w0"VUI$MJFOU$SFEFOUJBMT w"1*,FZ wΫϨσϯγϟϧ4FSDSFU.BOBHFSʹอଘ
"1*%FTUJOBUJPOʢ"1*Ѽઌʣͷར༻ྫ wྫɿTMBDLʹ௨͢Δ w-BNCEBΛར༻
"1*%FTUJOBUJPOʢ"1*Ѽઌʣͷར༻ྫ wྫɿTMBDLʹ௨͢Δ SecretsManagerͰೝূใऔಘ ΠϕϯτͷϖΠϩʔυΛݩʹύϥϝʔλ࡞ HTTPϦΫΤετΛૹͬͯΔ͚ͩ
"1*%FTUJOBUJPOʢ"1*Ѽઌʣͷར༻ྫ wྫɿTMBDLʹ௨͢Δ wஔ͖͑Δ͜ͱͰ࣮ෆཁɺηΩϡΞʹೝূใཧ
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/event-bridge-api- destinations-with-slack/
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/try-auth0-api-directly- from-event-bridge-authorization-typeoauth-client-credentials/
λʔήοτʹࢦఆͰ͖Δͷ wαϙʔτ͞Εͨ"84αʔϏε w"1*%FTUJOBUJPOʢ"1*Ѽઌʣ wผΞΧϯτͷΠϕϯτόε wผϦʔδϣϯͷΠϕϯτόε https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-targets.html
λʔήοτʹผΞΧϯτͷΠϕϯτόεΛࢦఆ ΫϩεΞΧϯτ࿈ܞ wૄ݁߹ʹ࿈ܞͰ͖Δ
λʔήοτʹผΞΧϯτͷΠϕϯτόεΛࢦఆ ΫϩεΞΧϯτ࿈ܞ wૄ݁߹ʹ࿈ܞͰ͖Δ ͕ࣗଘࡏ͢ΔAWSΞΧϯτͷ EventBridgeͷΈҙࣝ͢ΕΑ͍
λʔήοτʹผΞΧϯτͷΠϕϯτόεΛࢦఆ ΫϩεΞΧϯτ࿈ܞ wૄ݁߹ʹ࿈ܞͰ͖Δ ґଘ͕ؔEventBridgeʹด͡Δ
λʔήοτʹࢦఆͰ͖Δͷ wαϙʔτ͞Εͨ"84αʔϏε w"1*%FTUJOBUJPOʢ"1*Ѽઌʣ wผΞΧϯτͷΠϕϯτόε wผϦʔδϣϯͷΠϕϯτόε https://docs.aws.amazon.com/ja_jp/eventbridge/latest/userguide/eb-targets.html
λʔήοτʹผϦʔδϣϯͷΠϕϯτόε ϦʔδϣϯؒͷΠϕϯτసૹʹΑΔΠϕϯτू wಉҰΞΧϯτͷΠϕϯτू wड৴ՄೳͳϦʔδϣϯ wόʔδχΞɺΦϨΰϯɺΞΠϧϥϯυ https://aws.amazon.com/jp/blogs/compute/introducing-cross-region-event-routing-with-amazon- eventbridge/ ਤͷҾ༻ݩ
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/amazon- eventbridge-introduces-support-cross-region-event- bus-targets/
Amazon EventBridgeͷศརͳػೳ
4DIFNB3FHJTUSZ w&WFOU#SJEHFͰΓऔΓ͞ΕΔ༷ʑͳσʔλͷεΩʔϚΛ ཧ w0QFO"1* +40/4DIFNB%SBGUͰอଘՄೳ wεΩʔϚͷόʔδϣϯཧՄೳ JsonߏɺϓϩύςΟͷҰཡܕใΛཧ
4DIFNB3FHJTUSZ w&WFOU#SJEHFͰΓऔΓ͞ΕΔ༷ʑͳσʔλͷεΩʔϚΛ ཧ w0QFO"1* +40/4DIFNB%SBGUͰอଘՄೳ wεΩʔϚͷόʔδϣϯཧՄೳ Exportͯ͠όϦσʔγϣϯʹར༻Ͱ͖Δ
+40/4DIFNB w࣮ߦ࣌ͷόϦσʔγϣϯ͕Մೳ https://dev.classmethod.jp/articles/json-validation/
4DIFNB%JTDPWFSZ w&WFOU#SJEHFͰड͚औͬͨ4BB4ΠϕϯτΧελϜΠϕϯτ ͷεΩʔϚΛ0QFO"1*ܗࣜͰࣗಈอଘ
$PEF#JOEJOHT w"845PPMLJUGPS*OUFMMJ+ 7JTVBM4UVEJP$PEFΛ༻͍ͯ εΩʔϚఆٛΛऔಘՄೳ w+BWB 1ZUIPO 5ZQF4DSJQU ʹରԠ w࣮࣌ͷίʔυิίϯύΠϧ࣌ͷΤϥʔݕग़ʹར༻
3FQMBZ"SDIJWFػೳ w"SDIJWFɿࢦఆͨ͠ύλʔϯͷΠϕϯτΛอଘ w3FQMBZɿ"SDIJWFͨ͠ΠϕϯτΛ࠶ੜ wઃఆͨ͠ϧʔϧɺλʔήοτͷಈ࡞֬ೝ͕༰қʹ
ͬͯΈͨϒϩάͷհ https://dev.classmethod.jp/articles/ eventbridge-record-createaccount-event/ https://dev.classmethod.jp/articles/ amazon-eventbridge-archive-replay/
·ͱΊ
·ͱΊ "NB[PO&WFOU#SJEHF wαʔόʔཧෆཁͰΠϕϯτόε͕ར༻ w࣮ͳ͠Ͱ"84αʔϏεɺ4BB4ͳͲΞϓϦΛ࿈ܞ wૄ݁߹ͳΠϕϯτۦಈΞʔΩςΫνϟͷߏங͕༰қ wΠϕϯτεΩʔϚͷࣗಈݕɺอଘɺཧ w։ൃΛޮΛ্͛Δศརͳػೳ͕ͨ͘͞Μ͋Δ
ࢀߟࢿྉ
ࢀߟࢿྉ https://www.slideshare.net/AmazonWebServicesJapan/20210127-aws-expert-online-13-241967722 https://pages.awscloud.com/rs/112-TZM-766/images/DevAx_connect_day7_SaaS_integration_shared.pdf https://pages.awscloud.com/rs/112-TZM-766/images/ Amazon%20EventBridge%20%E3%81%AE%E4%BE%BF%E5%88%A9%E3%81%AA%E6%A9% 9F%E8%83%BD%20%2B%20%E6%96%B0%E6%A9%9F%E8%83%BD.pdf https://d1.awsstatic.com/webinars/jp/pdf/services/20200122_BlackBelt_EventBridge.pdf On-demand γʔζϯ
1ʮΠϕϯτۦಈʯ https://aws.amazon.com/jp/devax-connect-on-demand/
None