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

Step Functionsの設計時に知っておいたほうがいいかもしれないこと

Step Functionsの設計時に知っておいたほうがいいかもしれないこと

Hiroyuki ANAI

November 17, 2022
Tweet

More Decks by Hiroyuki ANAI

Other Decks in Programming

Transcript

  1. !QJSPTJLJDL
    "844UBSUVQ5FDI.FFUVQ෱Ԭd͍ͥ͘ʂαʔόʔϨεʂd
    4UFQ'VODUJPOTͷઃܭ࣌ʹ
    ஌͓͍ͬͯͨ΄͏͕
    ͍͍͔΋͠Εͳ͍͜ͱ

    View full-size slide

  2. ࣗݾ঺հ
    w !QJSPTJLJDL
    w ݀Ҫ޺޾
    w גࣜձࣾ;FOFʢδʔϯʣͱ͍͏ελʔτΞοϓͰ$50Λ΍͍ͬͯ·͢
    w Ϗʔϧ͕޷͖Ͱ͢

    View full-size slide

  3. גࣜձࣾ;FOF
    ##$ͷҨ఻ࢠղੳ🧬ͷελʔτΞοϓ
    w ##$ฐࣾˠ݈߁อݥ૊߹ˠ૊߹һ
    w ৄ͘͠͸IUUQTXXX[FOFDPKQ
    w ΤϯδχΞ͕গͳ͍ͷͰ৭ʑαʔόϨεʹد͍ͤͯΔ
    w 8FCΞϓϦέʔγϣϯ͸"NQMJGZ
    w "1*(BUFXBZ-BNCEBͰ(SBQI2-ͷ"1*
    w ͳͲͳͲ

    View full-size slide

  4. ࠓ೔࿩͢͜ͱ
    w 4UFQ'VODUJPOTɺศརͰΑ͘࢖͍ͬͯΔ͕
    w υΩϡϝϯτΛಡΜͰ͍Δͱ͖΍։ൃ࣌ʹ͸ؾ͖ͮʹ͍͘ɺ

    ຊ൪ӡ༻࣌ʹࠔͬͨ͜ͱʹ͍ͭͯ
    w ೖग़ྗͷΫΥʔλʹ͍ͭͯ
    w &$4λεΫͷ࣮ߦʹ͍ͭͯ

    View full-size slide

  5. ೖग़ྗͷΫΥʔλʹ͍ͭͯ

    View full-size slide

  6. ೖग़ྗͷαΠζʹ͸্ݶ͕͋Δ
    IUUQTEPDTBXTBNB[PODPNKB@KQTUFQGVODUJPOTMBUFTUEHMJNJUTPWFSWJFXIUNM

    View full-size slide

  7. ฐࣾͷࣄྫɿղੳ݁ՌͷϨϙʔτͷग़ྗॲཧ
    લ൒͸είΞܭࢉɺޙ൒͸ը૾ˍ1%'ੜ੒

    View full-size slide

  8. Ϣʔβʔ਺͕૿͑ͯɺ͋Δ೔ಥવམͪΔΑ͏ʹͳΔɻɻɻ
    ೖग़ྗͷαΠζ͕ΫΥʔλΛ௒ա🥺

    View full-size slide

  9. εέʔϧͦ͠͏ͳσʔλ͸4౳ʹग़ྗɺ44FMFDU౳Ͱࢀর
    %ZOBNP%#Ͱ΋Αͦ͞͏

    View full-size slide

  10. &$4λεΫʹ͍ͭͯ

    View full-size slide

  11. ฐࣾͷࣄྫɿҨ఻ࢠσʔλͷऔಘɾݕ඼ͷ4'
    Ϣʔβʔ૿ˠ
    ϑΝΠϧ༰ྔ૿Ͱ
    ෼ʹऩ·Βͳ͘ͳͬͨ😨

    View full-size slide

  12. ೖྗʹ͍ͭͯ
    -BNCEBͷ৔߹ɿ4'ͷػೳͰॊೈʹ੔ܗՄೳ
    new tasks.LambdaInvoke(this, "…", {


    …,


    payload: sfn.TaskInput.fromObject({


    hoge: sfn.JsonPath.stringAt("…"),


    fuga: sfn.JsonPath.stringAt("…"),


    …,


    }),


    …,


    });
    4'ͷग़ྗ಺͔Β͔͖ूΊͯ੔ܗͰ͖Δ👌

    View full-size slide

  13. ೖྗʹ͍ͭͯ
    &$4λεΫͷ৔߹ɿॊೈʹ͸Ͱ͖ͳ͍ʁ
    new tasks.EcsRunTask(this, "…", {


    …,


    containerOverrides: [


    {


    containerDefinition: …,


    environment: [


    {


    name: "INPUT_JSON",


    value: sfn.JsonPath.jsonToString(


    sfn.JsonPath.objectAt("$.input")


    ),


    },


    ]


    },


    …,


    ],


    …,


    });
    4'ͷग़ྗ಺͔Βಛఆͷύε͔͠ࢦఆͰ͖ͳ͍ʁ
    ؀ڥม਺Λ͍ͬͺ͍࢖͑͹Ͱ͖Δ͕🤔
    ඞཁʹԠͯ͡1BTT΍-BNCEBΛલʹڬΜͰɺ
    ೖྗΛ੔ܗ࣮ͯ͠ߦ͢ΔͳͲͨ͠

    View full-size slide

  14. ग़ྗʹ͍ͭͯ
    &$4λεΫ͸ΞϓϦέʔγϣϯ͔Β௚઀ग़ྗͰ͖ͳ͍ʁ

    View full-size slide

  15. ग़ྗʹ͍ͭͯ
    &$4λεΫ͔Βग़ྗΛ࢖͍͍ͨ৔߹
    03

    View full-size slide

  16. ͦͷଞɺ࢖͍ͬͯͯࢥͬͨ͜ͱ
    w 4'ෳ਺ͷ-BNCEBͱͰ͔͍&$4λεΫɺ

    Ͳ͕ͬͪΑ͔ͬͨͷ͔ະͩʹ೰Ή
    w σόοά΍ϦτϥΠ͕͠ΜͲ͘ͳΔͷͰɺ

    దٓ4'Λ෼ׂͨ͠΄͏͕Α͍
    w ֤αʔϏεͷग़ྗϑΥʔϚοτ͕ຖճΘ͔Βͳ͘ͳΔ
    w $%,͕͔ͳΓෳࡶʹͳͬͯ͠·͏
    w +40/ͷఆٛͱࣅͨײ͡ͷΠϯλʔϑΣʔε΄͍͠

    View full-size slide