Lambda銈掑疅琛屻仚銈嬨仺銇嶃伄IAM Role瑷畾鏂规硶


AWS Lambda銇甀AM Role瑷畾銇儭銉€仹銇欍

AWS Lambda銇瓼unction銈掍綔銇c仸AWS SDK Java銇嬨倝鍒╃敤銇椼倛銇嗐仺銇椼仧銇ㄣ亶銇┍銇с仚銆

闁嬬櫤鏅傘伅Admin銇俱仧銇疨ower銇銇欍倠AWS銈€偒銈︺兂銉堛仹闁嬬櫤銈掋仚銈嬨伄銇ц壇銇勩仺鎬濄亜銇俱仚銇屻併亜銇栨湰鐣挵澧冦仹AWS Lambda銈掋偝銉笺儷銇欍倠Java銉椼儹銈般儵銉犮倰鍕曘亱銇欍仺銇倠銇ㄨ┍銇銈忋仯銇︺亶銇俱仚銆

鍫村悎銇倛銈嬨仺鎬濄亜銇俱仚銇屻併仢銇儣銉偘銉┿儬銈掑嫊銇忋優銈枫兂銈勩併仢銇優銈枫兂銇屽埄鐢ㄣ仚銈婣WS銈€偒銈︺兂銉堛亴鍒堕檺銇曘倢銇熴儲銉笺偠锛堛儹銉笺儷锛夈仩銇c仧銈娿仚銈嬪牬鍚堛伀灏戙仐鍥般倞銇俱仚銆傘仧銇勩仸銇勩仢銇嗐亜銇嗐偙銉笺偣銇у垵銈併仸Lambda銈掍娇銇嗛枊鐧恒倰銇椼仧鍫村悎銇疞ambda銇瓼unction銈掋偝銉笺儷銇欍倠妯╅檺銇岃ō瀹氥仌銈屻仸銇勩仾銇勩伄銇с伅銇亜銇с仐銈囥亞銇嬶紵

鑷垎銇仢銇嗐仹銇椼仧銉汇兓銉汇傘仺銇勩亞銈忋亼銇с仢銇ō瀹氥伀灏戙仐鎵嬮枔鍙栥仯銇熴伄銇с儭銉€仐銇︺亰銇嶃伨銇欍

瑷畾鏂规硶

銇ㄨ█銇c仸銈傘仢銈屻伝銇╅洠銇椼亜瑭便仹銇劇銇勩仹銇欍

IAM銇偝銉炽偨銉笺儷銇銇c仸

IAM_Management_Console

銇俱仛銇儩銉偡銉笺倰浣滄垚銆

Policy Generator銇цō瀹氥仐銇俱仚銆

IAM_Management_Console

銈€偗銈枫儳銉炽伄閮ㄥ垎銇疘nvokeAsync銇↖nvokeFunction銈掗伕鎶炪仐銇俱仚銆

ARN銇嚜鍒嗐亴鎸併仯銇︺亜銈婰ambdaFunction銇瓵RN銇с仚銆傘宎rn:aws:lambda:ap-northeast-1:xxxxx:function:*銆嶃仺銇嬭ō瀹氥仐銇︺亰銇戙伆鍏ㄩ枹鏁颁娇銇堛伨銇欍(xxxxx銇仺銇撱亗銇熴倞銇汉銇倛銇c仸閬曘亞銇仛)

銆屻偣銉嗐兗銉堛儭銉炽儓銈掕拷鍔犮嶃倰鎶笺仐銇︺佸緦銇綔鎴愩仐銇烶olicy銈掕嚜鍒嗐伄瀵捐薄銇甊ole銈刄ser銇壊銈婂綋銇︺倢銇板畬浜嗐仹銇欍傝嚜鍒嗐伅銇仠銇婮ava銉椼儹銈般儵銉犮亴銇嗐伨銇忓嫊銇嬨仾銇嬨仯銇熴伄銇с併儣銉偘銉┿儬(JVM)銈掑啀璧峰嫊銇椼仧銈夈仭銈冦倱銇ㄦī闄愩亜銇戙仸銇俱仐銇熴

浜恒伀銈堛仯銇︺伅銇撱倢銇犮亼銇с伅瓒炽倞銇俱仜銈撱傝嚜鍒嗐伄鍫村悎銇疞ambda銇嬨倝浠栥伄AWS銉偨銉笺偣銇偄銈偦銈广仐銇亜銇仹銇撱倢銇х祩銈忋倞銇с仚銇屻併偄銈偦銈广仚銈嬩汉銇緥銇堛伆DynamoDB銇搞伄Execution妯╅檺銈傚繀瑕併伀銇倞銇俱仚銆

浠ヤ笅銇浜嬨亴鍙傝冦伀銇倠銇ㄦ濄亜銇俱仚銆傝嚜鍒嗐倐鍔┿亼銈夈倢銇俱仐銇熴兓銉汇兓锛

http://qiita.com/studio-kakky/items/3791ba5f383f1797f73f

銇俱仺銈

  • Policy銈掍綔銇c仸鑷垎銇甃ambdaFunction銈扞nvoke銇с亶銈嬨倛銇嗐伀銇椼倛銇
  • LambdaFunction銇屼粬銇瓵WS銉偨銉笺偣銇偄銈偦銈广仚銈嬪牬鍚堛伅妯╅檺杩藉姞銇椼倛銇嗭紙鑷垎銇倓銇c仸銇亜銇仹瑭崇窗涓嶆槑锛
  • Policy銈扲ole銇婾ser銇壊銈婂綋銇︺倛銇
  • 涓蹇淎WS SDK銈掑埄鐢ㄣ仚銈嬨儣銉偘銉┿儬銈掑啀璧峰嫊銇椼仧銇汇亞銇屻亜銇勩亱銈

銇с亶銈屻伆銇撱亞銇勩亞銇ㄣ亾銈嶃仹銇簱銇嶃仧銇忋仾銇勩仹銇欍倛銇紒瑾般亱銇焦銇珛銇︺伆骞搞亜銇с仚銆