{"id":40338,"date":"2024-11-26T11:17:24","date_gmt":"2024-11-26T03:17:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/40338\/"},"modified":"2024-11-26T11:17:24","modified_gmt":"2024-11-26T03:17:24","slug":"aws-lambda-%e7%ae%80%e4%bb%8b%ef%bc%9a%e6%97%a0%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e5%8a%9b%e9%87%8f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/40338\/","title":{"rendered":"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf"},"content":{"rendered":"<p><strong>aws lambda<\/strong> \u662f amazon web services (aws) \u7684\u4e00\u9879\u670d\u52a1\uff0c\u5141\u8bb8\u60a8\u8fd0\u884c\u4ee3\u7801\u800c\u65e0\u9700\u9884\u7f6e\u6216\u7ba1\u7406\u670d\u52a1\u5668\u3002 aws lambda \u91c7\u7528\u65b0\u7684\u65e0\u670d\u52a1\u5668\u65b9\u6cd5\uff0c\u63d0\u4f9b\u81ea\u52a8\u6269\u5c55\u3001\u57fa\u4e8e\u4e8b\u4ef6\u7684\u6267\u884c\u4ee5\u53ca\u6839\u636e\u5b9e\u9645\u6d88\u8017\u8fdb\u884c\u8ba1\u8d39\u7684\u529f\u80fd\uff0c\u4f7f\u5176\u6210\u4e3a\u8bb8\u591a\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u7406\u60f3\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<h2> \u4ec0\u4e48\u662f AWS Lambda\uff1f <\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173241023821249.jpg\" class=\"aligncenter\" title=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe\" alt=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe\" \/><\/p>\n<p>AWS Lambda \u662f\u4e00\u4e2a\u57fa\u4e8e\u4e8b\u4ef6\u7684\u8ba1\u7b97\u5e73\u53f0\u3002\u60a8\u53ea\u9700\u7f16\u5199\u4ee3\u7801\u5e76\u5b9a\u4e49\u5c06\u89e6\u53d1\u5b83\u7684\u4e8b\u4ef6\uff0cAWS \u5c31\u4f1a\u5904\u7406\u5176\u4ed6\u4e00\u5207\uff1a\u8d44\u6e90\u5206\u914d\u3001\u6267\u884c\u548c\u6269\u5c55\u3002\u8fd9\u7b80\u5316\u4e86\u5f00\u53d1\u3001\u964d\u4f4e\u4e86\u6210\u672c\u5e76\u52a0\u5feb\u4e86\u5b9e\u65bd\u65f6\u95f4\u3002<\/p>\n<h2> \u5b83\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f <\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173241023866135.jpg\" class=\"aligncenter\" title=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe1\" alt=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe1\" \/><\/p>\n<p><strong>1\u3002\u51fd\u6570\u521b\u5efa\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u4ee3\u7801\u4e0a\u4f20\u5230Lambda\uff08Python\u3001Node.js\u3001Java\u3001Go\u7b49\u8bed\u8a00\uff09\u3002<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6e\u89e6\u53d1\u51fd\u6570\u6267\u884c\u7684\u4e8b\u4ef6\uff0c\u4f8b\u5982\u4e0a\u4f20\u5230 S3\u3001\u53d1\u9001\u5230 SQS \u7684\u6d88\u606f\u6216\u901a\u8fc7 API \u7f51\u5173\u7684 HTTP \u8bf7\u6c42\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>2\u3002\u57fa\u4e8e\u4e8b\u4ef6\u7684\u6267\u884c\uff1a<\/strong><\/p>\n<ul>\n<li>\n<p>\u5f53\u4e8b\u4ef6\u53d1\u751f\u65f6\uff0cAWS \u5728\u6258\u7ba1\u73af\u5883\u4e2d\u6267\u884c\u5176\u529f\u80fd\u3002<\/p>\n<\/li>\n<li>\n<p>\u6267\u884c\u540e\uff0c\u73af\u5883\u81ea\u52a8\u5173\u95ed\u3002<\/p>\n<\/li>\n<\/ul>\n<p><strong>3\u3002\u6309\u9700\u4ed8\u6b3e\uff1a<\/strong><\/p>\n<ul>\n<li>\u60a8\u53ea\u9700\u4e3a\u6267\u884c\u65f6\u95f4\uff08\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\uff09\u548c\u8bf7\u6c42\u6570\u91cf\u4ed8\u8d39\u3002<\/li>\n<\/ul>\n<h2> AWS Lambda \u7684\u4f18\u70b9 <\/h2>\n<p><strong>1\u3002\u81ea\u52a8\u53ef\u6269\u5c55\u6027\uff1a<\/strong><\/p>\n<ul>\n<li>Lambda \u81ea\u52a8\u6269\u5c55\uff0c\u540c\u65f6\u5904\u7406\u5355\u4e2a\u8bf7\u6c42\u6216\u6570\u5343\u4e2a\u8bf7\u6c42..<\/li>\n<\/ul>\n<p><strong>2\u3002\u6210\u672c\u6548\u76ca\uff1a<\/strong><\/p>\n<ul>\n<li>\u6ca1\u6709\u56fa\u5b9a\u6210\u672c\u3002\u60a8\u53ea\u9700\u6309\u4f7f\u7528\u91cf\u4ed8\u8d39\uff0c\u8fd9\u975e\u5e38\u9002\u5408\u521d\u521b\u516c\u53f8\u548c\u9884\u7b97\u6709\u9650\u7684\u9879\u76ee\u3002<\/li>\n<\/ul>\n<p><strong>3\u3002\u51cf\u5c11\u7ba1\u7406\uff1a<\/strong><\/p>\n<ul>\n<li>\u65e0\u9700\u7ba1\u7406\u670d\u52a1\u5668\u3001\u8865\u4e01\u6216\u8f6f\u4ef6\u66f4\u65b0\u3002<\/li>\n<\/ul>\n<ol>\n<li>\u4e0e AWS \u751f\u6001\u7cfb\u7edf\u96c6\u6210\uff1a<\/li>\n<\/ol>\n<ul>\n<li>\u4e0e\u5176\u4ed6 AWS \u670d\u52a1\u65e0\u7f1d\u534f\u4f5c\uff0c\u4f8b\u5982 S3\u3001DynamoDB\u3001API Gateway\u3001CloudWatch \u7b49\u3002<\/li>\n<\/ul>\n<p>AWS Lambda \u4f7f\u7528\u6848\u4f8b<\/p>\n<p><strong>1\u3002\u6570\u636e\u5904\u7406<\/strong><\/p>\n<ul>\n<li>\u5b9e\u65f6\u6570\u636e\u64cd\u4f5c\u548c\u64cd\u4f5c\uff0c\u4f8b\u5982\u8f6c\u6362\u4e0a\u4f20\u5230S3\u7684\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p><strong>2\u3002\u65e0\u670d\u52a1\u5668 API\uff1a<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528 API Gateway \u521b\u5efa\u548c API\uff0c\u5176\u4e2d Lambda \u5904\u7406\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<p><strong>3\u3002\u57fa\u7840\u8bbe\u65bd\u81ea\u52a8\u5316\uff1a<\/strong><\/p>\n<ul>\n<li>\u81ea\u52a8\u64cd\u4f5c\uff0c\u4f8b\u5982\u6269\u5c55\u8d44\u6e90\u6216\u542f\u52a8\u5907\u4efd\u3002<\/li>\n<\/ul>\n<p><strong>4\u3002\u804a\u5929\u673a\u5668\u4eba\u548c\u865a\u62df\u52a9\u7406\uff1a<\/strong><\/p>\n<ul>\n<li>\u4e0e Amazon Lex \u548c\u5176\u4ed6\u670d\u52a1\u96c6\u6210\u7684\u5f3a\u5927\u804a\u5929\u673a\u5668\u4eba\u3002<\/li>\n<\/ul>\n<h2> \u9650\u5236\u548c\u6311\u6218 <\/h2>\n<p>\u5c3d\u7ba1 Lambda \u5f88\u5f3a\u5927\uff0c\u4f46\u5b83\u4e5f\u6709\u5c40\u9650\u6027\uff1a<\/p>\n<ul>\n<li>\n<p><strong>\u6700\u5927\u6267\u884c\u65f6\u95f4\uff1a<\/strong>\u6bcf\u4e2a\u51fd\u6570\u6700\u591a\u53ef\u4ee5\u8fd0\u884c 15 \u5206\u949f\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u51b7\u542f\u52a8\uff1a<\/strong>\u9996\u6b21\u6267\u884c\u975e\u6d3b\u52a8\u51fd\u6570\u65f6\u53ef\u80fd\u4f1a\u7a0d\u6709\u5ef6\u8fdf\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u5185\u5b58\u548c\u4e34\u65f6\u5b58\u50a8\u9650\u5236\uff1a<\/strong> \u6700\u591a 10 GB \u5185\u5b58\u548c 512 MB \u4e34\u65f6\u5b58\u50a8\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5982\u4f55\u521b\u5efa\u60a8\u7684\u7b2c\u4e00\u4e2a Lambda \u51fd\u6570\uff1f<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173241023995725.jpg\" class=\"aligncenter\" title=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe2\" alt=\"AWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u63d2\u56fe2\" \/><\/p>\n<ol>\n<li>\u8f6c\u5230<strong>AWS \u7ba1\u7406\u63a7\u5236\u53f0\u3002<\/strong> <\/li>\n<li>\u5bfc\u822a\u5230 <strong>AWS Lambda<\/strong> \u5e76\u5355\u51fb\u201c\u521b\u5efa\u51fd\u6570\u201d\u3002<\/li>\n<li>\u9009\u62e9\u4ece\u5934\u5f00\u59cb\u521b\u5efa\u3001\u4f7f\u7528\u84dd\u56fe\u6216\u4ece\u5bb9\u5668\u5bfc\u5165\u3002<\/li>\n<li>\u914d\u7f6e\u529f\u80fd\u8be6\u7ec6\u4fe1\u606f\uff1a\u8bed\u8a00\u3001\u89e6\u53d1\u5668\u548c\u6743\u9650\u3002<\/li>\n<li>\u5728\u63a7\u5236\u53f0\u7f16\u8f91\u5668\u4e2d\u7f16\u5199\u6216\u4e0a\u4f20\u4ee3\u7801\u3002<\/li>\n<li>\u6d4b\u8bd5\u5e76\u90e8\u7f72\u60a8\u7684\u51fd\u6570\uff01<\/li>\n<\/ol>\n<h2> \u7ed3\u8bba <\/h2>\n<p>AWS Lambda \u662f\u65e0\u670d\u52a1\u5668\u5f00\u53d1\u9886\u57df\u7684\u4e00\u4e2a\u91cc\u7a0b\u7891\uff0c\u63d0\u4f9b\u654f\u6377\u6027\u3001\u6210\u672c\u6548\u76ca\u548c\u53ef\u6269\u5c55\u6027\u3002\u5b83\u975e\u5e38\u9002\u5408\u521d\u521b\u516c\u53f8\u3001\u9700\u8981\u9ad8\u5ea6\u7075\u6d3b\u6027\u548c\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u9879\u76ee\u3002\u901a\u8fc7\u5728\u60a8\u7684\u73af\u5883\u4e2d\u7406\u89e3\u5e76\u5b9e\u65bd Lambda\uff0c\u60a8\u53ef\u4ee5\u7b80\u5316\u67b6\u6784\u5e76\u4e13\u6ce8\u4e8e\u771f\u6b63\u91cd\u8981\u7684\u4e8b\u60c5\uff1a\u5f00\u53d1\u60a8\u7684\u4ea7\u54c1\u3002<\/p>\n<p>\u5982\u679c\u60a8\u521a\u521a\u5f00\u59cb\u4f7f\u7528 AWS \u6216\u8005\u60f3\u4e86\u89e3\u6709\u5173 Lambda \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u63a2\u7d22\u5b98\u65b9\u6587\u6863\u5e76\u5c1d\u8bd5\u521b\u5efa\u60a8\u7684\u7b2c\u4e00\u4e2a\u51fd\u6570\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fAWS Lambda \u7b80\u4ecb\uff1a\u65e0\u670d\u52a1\u5668\u7684\u529b\u91cf\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>aws lambda \u662f amazon web services (aws) \u7684\u4e00\u9879\u670d\u52a1\uff0c\u5141\u8bb8\u60a8\u8fd0\u884c\u4ee3\u7801\u800c\u65e0\u9700\u9884\u7f6e\u6216\u7ba1\u7406\u670d\u52a1\u5668\u3002 aws lambda \u91c7\u7528\u65b0\u7684\u65e0\u670d\u52a1\u5668\u65b9\u6cd5\uff0c\u63d0\u4f9b\u81ea\u52a8\u6269\u5c55\u3001\u57fa\u4e8e\u4e8b\u4ef6\u7684\u6267\u884c\u4ee5\u53ca\u6839\u636e\u5b9e\u9645\u6d88\u8017\u8fdb\u884c\u8ba1\u8d39\u7684\u529f\u80fd\uff0c\u4f7f\u5176\u6210\u4e3a\u8bb8\u591a\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u7684\u7406\u60f3\u89e3\u51b3\u65b9\u6848\u3002 \u4ec0\u4e48\u662f AWS Lambda\uff1f AWS Lambda \u662f\u4e00\u4e2a\u57fa\u4e8e\u4e8b\u4ef6\u7684\u8ba1\u7b97\u5e73\u53f0\u3002\u60a8\u53ea\u9700\u7f16\u5199\u4ee3\u7801\u5e76\u5b9a\u4e49\u5c06\u89e6\u53d1\u5b83\u7684\u4e8b\u4ef6\uff0cAWS \u5c31\u4f1a\u5904\u7406\u5176\u4ed6\u4e00\u5207\uff1a\u8d44\u6e90\u5206\u914d\u3001\u6267\u884c\u548c\u6269\u5c55\u3002\u8fd9\u7b80\u5316\u4e86\u5f00\u53d1\u3001\u964d\u4f4e\u4e86\u6210\u672c\u5e76\u52a0\u5feb\u4e86\u5b9e\u65bd\u65f6\u95f4\u3002 \u5b83\u662f\u5982\u4f55\u8fd0\u4f5c\u7684\uff1f 1\u3002\u51fd\u6570\u521b\u5efa\uff1a \u4ee3\u7801\u4e0a\u4f20\u5230Lambda\uff08Python\u3001Node.js\u3001Java\u3001Go\u7b49\u8bed\u8a00\uff09\u3002 \u914d\u7f6e\u89e6\u53d1\u51fd\u6570\u6267\u884c\u7684\u4e8b\u4ef6\uff0c\u4f8b\u5982\u4e0a\u4f20\u5230 S3\u3001\u53d1\u9001\u5230 SQS \u7684\u6d88\u606f\u6216\u901a\u8fc7 API \u7f51\u5173\u7684 HTTP \u8bf7\u6c42\u3002 2\u3002\u57fa\u4e8e\u4e8b\u4ef6\u7684\u6267\u884c\uff1a \u5f53\u4e8b\u4ef6\u53d1\u751f\u65f6\uff0cAWS \u5728\u6258\u7ba1\u73af\u5883\u4e2d\u6267\u884c\u5176\u529f\u80fd\u3002 \u6267\u884c\u540e\uff0c\u73af\u5883\u81ea\u52a8\u5173\u95ed\u3002 3\u3002\u6309\u9700\u4ed8\u6b3e\uff1a \u60a8\u53ea\u9700\u4e3a\u6267\u884c\u65f6\u95f4\uff08\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\uff09\u548c\u8bf7\u6c42\u6570\u91cf\u4ed8\u8d39\u3002 AWS Lambda \u7684\u4f18\u70b9 1\u3002\u81ea\u52a8\u53ef\u6269\u5c55\u6027\uff1a Lambda \u81ea\u52a8\u6269\u5c55\uff0c\u540c\u65f6\u5904\u7406\u5355\u4e2a\u8bf7\u6c42\u6216\u6570\u5343\u4e2a\u8bf7\u6c42.. 2\u3002\u6210\u672c\u6548\u76ca\uff1a \u6ca1\u6709\u56fa\u5b9a\u6210\u672c\u3002\u60a8\u53ea\u9700\u6309\u4f7f\u7528\u91cf\u4ed8\u8d39\uff0c\u8fd9\u975e\u5e38\u9002\u5408\u521d\u521b\u516c\u53f8\u548c\u9884\u7b97\u6709\u9650\u7684\u9879\u76ee\u3002 3\u3002\u51cf\u5c11\u7ba1\u7406\uff1a \u65e0\u9700\u7ba1\u7406\u670d\u52a1\u5668\u3001\u8865\u4e01\u6216\u8f6f\u4ef6\u66f4\u65b0\u3002 \u4e0e AWS \u751f\u6001\u7cfb\u7edf\u96c6\u6210\uff1a \u4e0e\u5176\u4ed6 AWS \u670d\u52a1\u65e0\u7f1d\u534f\u4f5c\uff0c\u4f8b\u5982 S3\u3001DynamoDB\u3001API Gateway\u3001CloudWatch \u7b49\u3002 AWS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-40338","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=40338"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/40338\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=40338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=40338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=40338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}