Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon EventBridgeでできることをまとめてみた #devio2021

ynishimura
October 05, 2021

Amazon EventBridgeでできることをまとめてみた #devio2021

DevelopersIO Decadeでビデオ登壇するにあたり作成した資料になります。

ynishimura

October 05, 2021
Tweet

More Decks by ynishimura

Other Decks in Technology

Transcript

  1. ੢ଜ༞ೋ "84ࣄۀຊ෦ΦϖϨʔγϣϯ෦ େࡕΦϑΟεࡏ੶ αʔόʔϨε؀ڥߏங ࣗݾ঺հ  - 2021 APN AWS

    Top Engineer/ APN ALL AWS Certi fi cations Engineer - 2020 APN AWS Top Engineers - 2019 APN AWS Top Engineers
  2. Πϝʔδ  ಠࣗ"QQ 4BB4 "84αʔϏε Amazon EventBridge Πϕϯτ ϧʔϧ Πϕϯτιʔε

    λʔήοτ ϧʔϧ ϧʔϧ 4BB4 "84αʔϏε ผ"84؀ڥ Πϕϯτόεʴϧʔϧ Πϕϯτ
  3. Πϕϯτͱ͸  Πϕϯτ͸ঢ়ଶมԽΛද͢ +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" } }
  4. Πϕϯτιʔε  छྨ Πϕϯτͷछྨ ૹ৴ݩ ૹ৴ઌͷΠϕϯτόε ૹ৴͞ΕΔλΠϛϯά "84αʔϏεͷΠϕϯτ ֤"84αʔϏε σϑΥϧτͷ

    Πϕϯτόε "84αʔϏεͷঢ়ଶ͕ม Θͬͨͱ͖ ֤"84αʔϏε $MPVE5SBJMܦ༝ "84αʔϏεͷ"1*Λݺͼ ग़ͨ͠ͱ͖ ΧελϜΠϕϯτ ΞϓϦέʔγϣϯ ૹ৴࣌ʹࢦఆ &WFOU#SJEHFͷ1VU&WFOUT "1*Λݺͼग़ͨ͠ͱ͖ 4BB4Πϕϯτ 4BB4ΞϓϦέʔγϣϯ ֤4BB4͝ͱʹ࡞੒͞ΕΔ ύʔτφʔΠϕϯτόε 4BB4ΞϓϦέʔγϣϯʹ ΑͬͯҟͳΔ
  5. Πϕϯτύλʔϯ  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Πϯελϯεͷऴྃʹ͍ͭͯ௨஌Λड͚͍ͨΠϕϯτύλʔϯྫ
  6. τϥϯεϑΥʔϚʔ  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ͷঢ়ଶมԽͷΠϕϯτ