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

HIGOBASHI.AWS 第5回 「初めてサーバーレス開発をやってみた振り返り」

HIGOBASHI.AWS 第5回 「初めてサーバーレス開発をやってみた振り返り」

2018/7/27に開催されたHIGOBASHI.AWS 第5回の発表資料です。

サーバーレス開発未経験者が入社〜2ヶ月間のサーバーレス開発を振り返り、
・ハマった点
・もっとこうすれば良かったという反省点
・うまくいった点
についてお話ししました。

119659c28d16f22d01eb48a6f3ee1391?s=128

TomoyaIwata

July 27, 2018
Tweet

More Decks by TomoyaIwata

Other Decks in Programming

Transcript

  1. ؠాɹஐ࠸ ॳΊͯαʔόʔϨε։ൃΛ΍ͬͯΈͨৼΓฦΓ

  2. εϥΠυ͸ޙͰೖख͢Δ͜ͱ͕ग़དྷ·͢ͷͰ ൃදதͷ಺༰ΛϝϞ͢Δඞཁ͸͋Γ·ͤΜɻ ࣸਅࡱӨΛ͢Δ৔߹͸ ϑϥογϡɾγϟολʔԻ͕ग़ͳ͍Α͏ʹ͝഑ྀ͍ͩ͘͞ Attention

  3. ࣗݾ঺հ   ؠాɹஐ࠸ w αʔόʔϨε։ൃ෦ w ೥݄ೖࣾ w Ϋϥϝιೖࣾ·Ͱ͸4JFSͰ೥ۈ຿

    w ӡ༻೥ डୗγεςϜܥӡ༻  w ։ൃ೥ /&5 1)1  w "84ྺɺαʔόʔϨεྺ໿ϲ݄
  4. ࠓ೔͓࿩͢͠Δ͜ͱ   w ॳΊͯͷαʔόʔϨε։ൃͰࢼߦࡨޡͯ͠Έͨ൓ল఺ w ϋϚͬͨͱ͜Ζɺ͏·͍ͬͨ͘ͱ͜Ζ౳ͷ5*14 w 1ZUIPOͷ࣮૷ͷ࿩

  5. ࠓ೔͓࿩͠͠ͳ͍͜ͱ   w ىঝస݁ͷ͋Δ·ͱ·ͬͨ࿩ w "84΍αʔόʔϨεͷجૅ஌ࣝ w ͜͏͍͏࣌͸͜͏ʂɹΈ͍ͨͳϕετϓϥΫςΟε࿦ w

    1ZUIPOҎ֎ͷݴޠͷ࿩
  6.   ೖࣾʙ্݄०·Ͱैࣄͨ͠ ։ൃҊ݅Λ୊ࡐʹ খωλΛ঺հ͍͖ͯ͠·͢

  7.   ϓϩδΣΫτͷ֓ཁ

  8. ϓϩδΣΫτͷ֓ཁ   w"1*(BUFXBZͱ-BNCEBΛ࢖༻ͨ͠3FTU"1*ͷ։ൃ͕ओͳλεΫ w։ൃͨ͠"1*͸ผϕϯμʔ͕ϞόΠϧΞϓϦ౳͔Βར༻ w݄͔Β1+࢝ಈɹ্݄०ʹຊ൪Քಇ։࢝ ˞ߏ੒͸؆ུԽͯ͠هࡌ͍ͯ͠·͢

  9. ࢖༻ٕͨ͠ज़   ΞϓϦέʔγϣϯϑϨʔϜ ϫʔΫ ಛʹͳ͠ ςετ༻ϥΠϒϥϦ 6OJU5FTUɺ.PUP ։ൃݴޠ 1ZUIPO

    ߏ੒؅ཧ "844". ιʔε؅ཧ (JU-BC $*$% (JU-BC$*$%
  10. ϓϩδΣΫτͷମ੍   w ૬ํɹ"͞Μ w ೥݄ೖࣾɾɾɾೖࣾ̍ϲ݄  w 1ZUIPOܦݧແ͠

    w ࢲ w ೥݄ೖࣾɾɾɾೖࣾϲ݄ w 1ZUIPOܦݧແ͠ Ҏ্ʂʂ
  11. ײ૝   (lllʉ˘ʉ)

  12.   ͜Μͳײ͡Ͱ։ൃ͕ελʔτ͠·ͨ͠

  13.   ͔͜͜ΒϓϩδΣΫτΛৼΓฦΓͳ͕Β ࢼߦࡨޡͨ͜͠ͱΛ͝঺հ͍͖ͯ͠·͢ɻ

  14. ৼΓฦΓ   ᶃAPIઃܭฤ

  15. "1*ઃܭฤ   w "1*ͷઃܭʹ͸4XBHHFSΛར༻ w "1*ʹؔ࿈͢Δ"84ͷॾʑͷϦ ιʔεΛఆٛͭͭ͠΋ɺఆٛϑΝ ΠϧΛͦͷ··υΩϡϝϯτͱ ͯ͠ྲྀ༻Մೳ

    w 4XBHHFS6*౳ͷπʔϧͱ૊Έ߹ ΘͤΔ͜ͱͰ؆୯ʹ"1*ͷςετ ؀ڥ͕࡞੒Ͱ͖Δɻ
  16. ઃܭʹ4XBHHFSΛར༻͢Δࡍͷ஫ҙ఺ᶃ   AWSͷAPI Gateway͸Swagger2.0ʹ ׬શରԠ͍ͯ͠Δ༁Ͱ͸ແ͍

  17. 4XBHHFSº"1*(BUFXBZඇޓ׵ͷྫ   "1*ར༻ऀଆͱͯ͠͸خ͍͠ ʮ&YBNQMFʯͰ͕͢ɺී௨ʹ"1* (BUFXBZʹΠϯϙʔτ͢ΔͱΤϥʔ ʹͳΓ·͢ɻ 4".ςϯϓϨʔτ΋ಉ༷Ͱɺී௨ ʹςϯϓϨʔτʹ&YBNQMFΛॻ͍ ͯ"1*ΛσϓϩΠ͢ΔͱɺσϓϩΠ

    ʹࣦഊ͠·͢ɻ
  18. ղܾࡦ   (JU-BC3VOOFS্ͰϏϧυͷδϣϒΛ࣮ߦ͢Δࡍɺ&YBNQMFΛ࡟আͯ͠ ͔ΒσϓϩΠΛ࣮ߦ "1*ఆٛΛެ։͢Δࡍ͸&YBNMF࡟আલͷఆٛϑΝΠϧΛ࢖༻

  19. ઃܭʹ4XBHHFSΛར༻͢Δࡍͷ஫ҙ఺ᶄ   SAMͰAPI GatewayͷઃఆΛߦ͏৔߹ɺ SwaggerΛ࢖͍ͬͯΔ͔Ͳ͏͔Ͱ هड़͕มΘΔ͜ͱ͕͋Δɻ

  20. ྫ   ྫ͑͹ɺ"1*(BUFXBZͷϨεϙϯεςϯϓϨʔτΛઃఆ͢Δ৔߹

  21. 4XBHHFSΛ࢖͏৔߹ͱ࢖Θͳ͍৔߹Ͱॻ͖ํ͕ҧ͏ʂ   ɾɾɾུ x-amazon-apigateway-gateway-responses: DEFAULT_4XX: responseTemplates: application/json: > {"message":"$context.authorizer.message"}

    GatewayResponse: Type: "AWS::ApiGateway::GatewayResponse" Properties: ResponseTemplates: application/json: > {"message":"$context.authorizer.message"} ResponseType: DEFAULT_4XX RestApiId: !Ref HelloAPI "84"QJ(BUFXBZ(BUFXBZ3FTQPOTF ͷϓϩύςΟ3FTQPOTF5FNQMBUFTͰఆٛ YBNB[POBQJHBUFXBZHBUFXBZSFTQPOTFT Ͱఆٛ "84"QJ(BUFXBZ(BUFXBZ3FTQPOTFͰఆٛ͠ ͯ΋ແࢹ͞ΕΔ 4XBHHFSΛ࢖Θͳ͍৔߹ 4XBHHFSΛ࢖͏৔߹
  22. ֶΜͩ͜ͱ   ઃఆํ๏ʹ͍ͭͯωοτͰௐ΂ͨΓɺ υΩϡϝϯτΛಡΜͩΓ͢Δ৔߹͸ SwaggerΛ࢖͏৔߹ɾ࢖Θͳ͍৔߹Ͱ هड़͕มΘΔ͜ͱΛ೦಄ʹஔ͖ͳ͕Β ௐࠪ͢Δ

  23. ৼΓฦΓ   ᶄPython࣮૷ฤ

  24. ৼΓฦΓ   ᶄʔᶃDynamoDB΁ͷΞΫηε

  25. CPUPʹର͢ΔΠϝʔδ   ͍͍ͪͪςʔϒϧ໊Λࢦఆͨ͠Γ ΩʔͷଐੑΛࢦఆ͢Δͷ͕൥ࡶ ઈରλΠϙ͢Δࣗ৴͕͋ͬͨ import boto3 dynamodb =

    boto3.resource('dynamodb') table = dynamodb.Table('test') res = table.get_item(Key={ "hash_key": "1", "range_key": "ABC" }) ͍͍ײ͡ʹΫϥεઃܭͯ͠%ZOBNP%#΁ͷΞΫηεΛ؆ૉԽ͍ͨ͠ αʔόʔϨεΞϓϦͷσʔλετΞͱ͍͑͹%ZOBNP%#Ͱ͕͢ɾɾɾ
  26. ΍ͬͨ͜ͱ   ֤ςʔϒϧڞ௨ͷॲཧΛ࣮૷ͨ͠ந৅ ΫϥεΛ࡞੒͠ɺςʔϒϧຖʹ۩৅Ϋ ϥεΛ࡞੒ ςʔϒϧ໊΍Ωʔͷ৘ใ͸Ϋϥεͷ ϑΟʔϧυʹอ࣋͢ΔΑ͏ʹઃܭ ίϨͰݺͼग़͠ݩ͸ςʔϒϧࢦఆ΍Ωʔ ࢦఆͱ͍ͬͨ໘౗͝ͱ͔Βղ์͞ΕΔ

    ͸ͣʂʂ
  27. ΍ͬͨ͜ͱ   جఈΫϥε ۩৅Ϋϥε from abc import ABC, ABCMeta,

    abstractmethod from boto3.dynamodb.conditions import Key class TableBase(ABC): """ DynaoDBͷςʔϒϧૢ࡞ͷͨΊͷந৅Ϋϥε """ def __init__(self, dynamo): """ :param dynamo: """ self.__dynamo = dynamo @property def dynamo(self): return self.__dynamo @property @abstractmethod def table(self): pass @property @abstractmethod def table_name(self): pass @property @abstractmethod def hash_key(self): pass class MDeviceResourceState(TableBase): def __init__(self, dynamo): """ :param dynamo: """ super().__init__(dynamo) self.__table_name = os.getenv('M_DEVICE_RESOURCE_STATE') self.__hash_key = 'device_mng_id' self.__range_key = None self.__table = self.dynamo.Table(self.__table_name) @property def table_name(self)->str: return self.__table_name @property def table(self)->str: return self.__table @property def hash_key(self)->str: return self.__hash_key @property def range_key(self)->str: return self.__range_key def get_item_by_device_id(self, device_id): return self.__table.query( IndexName='GSI_device_id',
  28. ΍ͬͨ͜ͱ   kinesis_data = base64.b64decode(record['kinesis']['data']) kinesis_data = json.loads(kinesis_data, parse_float=Decimal)

    raw_data = kinesis_data['payloads'] # DynamoDB͔Βߋ৽લͷϨίʔυऔಘ device_id = kinesis_data['deviceId'] table = MDeviceResourceState(dynamo) before_item = table.get_item_by_device_id(device_id) ! ݺͼग़͠ଆͷ࣮૷͸ൺֱతγϯϓϧʹ ! λΠϙ͠ͳ͘ͳͬͨ
  29. ྑ͔ͬͨ఺   DynamoDB΁ΞΫηε͢ΔϩδοΫΛ શͯLambdaͷhandlerʹ٧ΊࠐΉͱ ݟ௨͕͠ѱ͘ͳͬͯਏ͍ ςʔϒϧຖʹઐ༻ΫϥεΛ༻ҙ͢Δͷ΋༗ޮ

  30. ൓ল఺   ςʔϒϧຖʹΫϥεΛ༻ҙ͢Δͱɺ ෳ਺ςʔϒϧΛލ͍ͩ Batch Get౳Λ͏·͘ϝιουʹ མͱ͠ࠐΊͳ͔ͬͨ

  31. ৼΓฦΓ   ᶄʔᶄAPIͷϩδοΫڞ௨Խ

  32. ॲཧͷڞ௨Խʹؔ͢Δ೰Έɾɾɾ   "1*ΛԿຊ΋࡞͍ͬͯΔͱɺେମॲཧ͕ࣅ௨ͬͯ͘Δ def lambda_handler(event, context): try: # ϦΫΤετύϥϝʔλΛ୯߲໨νΣοΫͯ͠NGͳΒ400Τϥʔฦ͢

    # ୯߲໨νΣοΫ͕OKͳΒؔ࿈νΣοΫͯ͠NGͳΒ400Τϥʔฦ͢ # ϝΠϯͷϏδωεϩδοΫ # OKͳΒϨεϙϯεΛฦ͢ɹྫ֎͕ൃੜͨ͠Β500ΤϥʔΛฦͨ͠Γ except Exception as e: logger.error(e) raise e ͏·͘ڞ௨Խ͍ͨ͠ɾɾɾ
  33. ΍ͬͨ͜ͱ   def valid_json_check(func): """ ϦΫΤετBODYʹଥ౰ͳJSON͕ૹΒΕ͖͍ͯͯΔ͔ΛνΣοΫ͢ΔσίϨʔλ JSON͕ૹΒΕ͖͍ͯͳ͍৔߹͸BadRequestΛฦ͢ :param func:

    :return: """ def json_check_wrapper(*args, **kwargs): body = args[0]["body"] if not is_valid_json(body): res_dict = add_system_time(({ "message": "request body not contain valid json" })) return HttpResponseUtil.bad_request(json.dumps(res_dict)) return func(*args, **kwargs) return json_check_wrapper @valid_json_check def lambda_handler(event, context): try: data = json.loads(event["body"]) v = Validator(__schema()) if v.validate(data) is not True: return HttpResponseUtil.bad_request(json.dumps(v.errors, cls=DecimalEncoder)) ϦΫΤετ#0%:ʹଥ౰ͳ +40/ؚ͕·Ε͍ͯͳ͚Ε͹ ΤϥʔΛฦ͢ ͱ͍ͬͨڞ௨ॲཧΛσίϨʔλ ͱ࣮ͯ͠૷ σίϨʔλͰڞ௨ॲཧΛ෇͚଍ ͍ͯ͘͜͠ͱͰɺ֤-BNEBͷ த਎͸ۃྗγϯϓϧʹ
  34. ྑ͔ͬͨ఺   ϦΫΤετͷόϦσʔγϣϯ΍ ྫ֎ͷϋϯυϦϯά౳ͷܾ·Γ͖ͬͨॲཧ͸ σίϨʔλΛ࢖ͬͯڞ௨Խ͢Δͷ΋༗ޮ

  35. ൓ল఺   σίϨʔλ͕࠷ద͔ͱݴΘΕΔͱٙ໰΋ APIͷछྨ(GET,POST,PUT,DELETE) ͝ͱʹجఈΫϥεΛ༻ҙͯ͠ɺ ֤APIͰ͸جఈΫϥεΛܧঝ͢ΔΑ͏ͳ ख๏΋ࠓޙࢼͯ͠Έ͍ͨ

  36. ൓ল఺   ͦ΋ͦ΋ϑϨʔϜϫʔΫΛ࢖͏ͱ͍͏ બ୒ࢶ͸ແ͔ͬͨͷ͔ʁ Chalice΍Flask౳

  37. ৼΓฦΓ   ᶅςετฤ

  38. 6OJUςετʹ͓͚Δ%ZOBNP%#ͷςʔϒϧఆٛ؅ཧ   6OJUςετ͸NPUPͰ %ZOBNP%#ΛϞοΫ 6OJUςετͷ'JYUVSF಺Ͱ ςʔϒϧΛ࡞੒͢Δඞཁ͕͋Δ

  39. ίϨ͸ݏɾɾɾ   @mock_dynamodb2 def test_get_api(self): dynamodb = boto3.resource('dynamodb') dynamodb.create_table(

    TableName='Movies', KeySchema=[ { 'AttributeName': 'year', 'KeyType': 'HASH' }, { 'AttributeName': 'title', 'KeyType': 'RANGE' } ], AttributeDefinitions=[ { 'AttributeName': 'year', 'AttributeType': 'N' }, { 'AttributeName': 'title', 'AttributeType': 'S' }, ], ProvisionedThroughput={ 'ReadCapacityUnits': 10, 'WriteCapacityUnits': 10 } ) ςʔϒϧఆٛ͸4".ςϯϓϨʔ τͰ؅ཧ͍ͯ͠Δͷʹɺςετίʔ υʹ͍͍ͪͪςʔϒϧఆٛΛॻ͖ ͨ͘ͳ͍
  40.   SAMςϯϓϨʔτΛύʔεͯ͠ɺ ύʔεͨ͠ఆ͔ٛΒςετ༻ͷ DynamoDBͷςʔϒϧΛ࡞Γ͍ͨ

  41. %ZOBNP%#ͷఆٛΛύʔεͨ͠ࡍͷΤϥʔᶃ   yaml.constructor.ConstructorError: could not determine a constructor for

    the tag ‘!Sub’ in "dynamo.yml", line 16, column 18
  42. %ZOBNP%#ͷఆٛΛύʔεͨ͠ࡍͷΤϥʔᶄ   5SBDFCBDL NPTUSFDFOUDBMMMBTU  'JMFUFTUQZ MJOF JONPEVMF NBJO

     'JMFUFTUQZ MJOF JONBJO EBUBZBNMMPBE pMF  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNM@@JOJU@@QZ MJOF JOMPBE SFUVSOMPBEFSHFU@TJOHMF@EBUB  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JOHFU@TJOHMF@EBUB SFUVSOTFMGDPOTUSVDU@EPDVNFOU OPEF  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@EPDVNFOU GPSEVNNZJOHFOFSBUPS 'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@ZBNM@NBQ WBMVFTFMGDPOTUSVDU@NBQQJOH OPEF  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@NBQQJOH SFUVSOTVQFS DPOTUSVDU@NBQQJOH OPEF EFFQEFFQ  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@NBQQJOH WBMVFTFMGDPOTUSVDU@PCKFDU WBMVF@OPEF EFFQEFFQ  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@PCKFDU EBUBDPOTUSVDUPS TFMG OPEF  'JMF6TFSTJXBUBUPNPZB%PDVNFOUTYYYYYMJCQZUIPOTJUFQBDLBHFTZBNMDPOTUSVDUPSQZ MJOF JODPOTUSVDU@VOEFpOFE OPEFTUBSU@NBSL  ZBNMDPOTUSVDUPS$POTUSVDUPS&SSPSDPVMEOPUEFUFSNJOFBDPOTUSVDUPSGPSUIFUBHb4VC`JOEZOBNPZNM MJOF DPMVNO
  43. "84$-*ͷؔ਺Λ࢖༻ͯ͠%ZOBNP%#ͷఆٛΛύʔε   w 4VC΍3FGͷΑ͏ͳ୹ॖه๏͸:".-ͱͯ͠͸ύʔεग़དྷͳ͍ w "84$-*಺ͷؔ਺Λ࢖͏͜ͱͰύʔεग़དྷΔ w ˞಺෦తʹ͸'O4VC΍'O3FGʹల։͞Ε͍ͯΔ IUUQTEFWDMBTTNFUIPEKQTFSWFSTJEFTFSWFSMFTTEZOBNPMPDBMGSPNDGO

    from awscli.customizations.cloudformation.yamlhelper import yaml_parse def main(): with open("dynamo.yml") as file: data = yaml_parse(file.read()) # ςετ༻ͷςʔϒϧΛ࡞੒͢Δॲཧ # .... if __name__ == '__main__': main()
  44. ࠷ऴܥ   w 'JYUVSFͷςʔϒϧ࡞੒ָ͕νϯʹ w ςʔϒϧఆٛͷ؅ཧΛҰݩԽ͢Δ͜ͱʹ੒ޭ region = os.getenv('AWS_DEFAULT_REGION',

    'ap-northeast-1') self.dynamodb = boto3.resource('dynamodb', region_name=region) table_fixture = CreateTableFixture(self.dynamodb) table_fixture.create_m_device_resources_state()
  45. ৼΓฦΓ   ᶆෆ۩߹ରԠฤ

  46. ৼΓฦΓ   ᶆʔᶃDynamoDBۭจࣈྻ໰୊

  47. ෆ۩߹ରԠᶃ   ͓٬༷͔Βͷ໰͍߹Θͤ ఆظతʹ࣮ߦͯ͠Δॲཧ͕ίέͯΔͬΆ͍ $MPVE8BUDI-PHTΛ ֬ೝ͢Δͱɾɾɾ

  48. Τϥʔϝοηʔδ   botocore.exceptions.ClientError: An error occurred (ValidationException) when callin

    g the PutItem operation: One or more parameter values were invalid: An Attribut eValue may not contain an empty string
  49. ֶΜͩ͜ͱ   DynamoDBͷϨίʔυΛొ࿥ɾߋ৽͢Δࡍɺ ஋ʹۭจࣈྻ͸ઃఆͰ͖ͳ͍ɻ ೖྗ஋ʹۭจࣈྻ͕ೖ͍ͬͯΔ͔ΛνΣοΫ ͠ɺNoneʹม׵͢ΔͳΓɺ߲໨͝ͱ࡟আ͢Δ ͳΓ͢Δඞཁ͕͋Δɻ

  50. ൓ল఺   ೖྗ஋ΛશͯνΣοΫ͢Δͷ͸໘౗ جఈςʔϒϧΫϥεͷ6QEBUF 1VUॲཧʹ ۭจࣈྻˠ/POFͷม׵ॲཧΛ ࣮૷͓͚ͯ͠͹ྑ͔ͬͨɾɾɾ

  51. ࢀߟ   Pythonͷ৔߹͸ࣗྗͰؤுΔඞཁ͕͋Γ·͢ ͕ɺNode.jsͩͱdocument clientͷίϯετ ϥΫλͰconvertEmptyValuesͱ͍͏ύϥ ϝʔλΛࢦఆ͢Δ͜ͱͰۭจࣈྻˠNULL΁ͷ ม׵Λউखʹ΍ͬͯ͘Ε·͢ɻ https://github.com/aws/aws-sdk-js/pull/1268

  52. ৼΓฦΓ   ᶆ−ᶄSNSͰΤϥʔ௨஌དྷͳ͍໰୊

  53. ෆ۩߹ରԠᶄ   ઌ΄ͲͷۭจࣈྻʹΑΔΤϥʔɾɾɾ ͓٬༷͔Β໰͍߹Θ͕ͤདྷΔ·Ͱ ؾ෇͍͍ͯ·ͤΜͰͨ͠ɻ

  54.   σουϨλʔΩϡʔΛઃఆͯ͠ 4/4Ͱ௨஌͢ΔΑ͏ઃఆ͍ͯͨ͠ͷʹ ͳͥݕ஌Ͱ͖ͳ͔ͬͨͷ͔ʁʁ ❌ ෆ۩߹ରԠᶄ

  55. ֶΜͩ͜ͱ   %-2͕༗ޮͳͷ͸ ετϦʔϜϕʔεͰ͸ͳ͍Πϕϯτιʔεͷ ඇಉظݺͼग़͠ͷ৔߹ %ZOBNP%#ετϦʔϜ΍ ,JOFTJT%BUB4USFBNT͔Βىಈ͢Δ -BNCEBͰ͸%-2͸ແҙຯ

  56. ॲཧ଴ͪϨίʔυ ͕଺ཹ ֶΜͩ͜ͱ   ͞Βʹɾɾɾ ετϦʔϜϕʔεͷΠϕϯτιʔε͔Βىಈ͢ΔLambda͕ ίέͨ৔߹ɺࣦഊͨ͠Ϩίʔυͷ༗ޮظݶ͕੾ΕΔ͔ॲཧ ͕੒ޭ͢Δ·Ͱɺ৽͍͠ϨίʔυͷಡΈࠐΈ͕ߦΘΕͳ͍ https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/retries-on-errors.html

    %ZOBNP%#ετϦʔϜ ❌
  57. ֶΜͩ͜ͱ   ετϦʔϜϕʔεͷΠϕϯτιʔε͔Β ىಈ͢ΔLambda͕ίέΔͱ ΠϯύΫτେʂʂ ಛʹೖ೦ͳςετΛʂ

  58. ·ͱΊ   w "1*(BUFXBZͱ4XBHHFSͷඇޓ׵͸$*$%Ͱٵऩ͢Δ w "1*Λઃܭ͢Δࡍ͸ɺ4XBHHFSͷར༻༗ແͰॻ͖ํ͕มΘΔ͜ͱΛ೦಄ʹ w %ZOBNP%#΁ͷΞΫηε͸CPUP୯ମͰ͸ͳ͘ɺؒʹΫϥεΛט·͢ͱ ָʹͳΓͦ͏ʁ

    w "1*ͷϩδοΫڞ௨ԽʹσίϨʔλ͕ޮՌత͔΋ʁ w %ZOBNP%#ͷςʔϒϧఆٛ͸ຊ൪༻΋ςετ༻΋Ұݩ؅ཧ͢Δ w %ZOBNP%#ʹ͸ۭจࣈྻొ࿥Ͱ͖ͳ͍ͷͰؾΛ͚ͭΔ w ετϦʔϜϕʔεͷΠϕϯτ͔Βىಈ͢Δ-BNCEB͸ೖ೦ͳςετΛ
  59. ·ͱΊ   ࠓճ͝঺հͨ͠TIPSΛࢀߟʹɺ ΑΓྑ͍αʔόʔϨεϥΠϑΛʂʂ

  60. ·ͱΊ   ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠