{"id":18628,"date":"2023-02-27T22:33:32","date_gmt":"2023-02-27T14:33:32","guid":{"rendered":"https:\/\/www.wqeq.com\/?p=18628"},"modified":"2023-03-02T14:22:51","modified_gmt":"2023-03-02T06:22:51","slug":"aws-serverless%e5%ad%a6%e4%b9%a0","status":"publish","type":"post","link":"https:\/\/www.wqeq.com\/?p=18628","title":{"rendered":"aws serverless\u5b66\u4e60"},"content":{"rendered":"<p>\u6700\u8fd1\u5165\u804c\u7684\u516c\u53f8\u9700\u8981\u4f7f\u7528\u4e9a\u9a6c\u900a\u7684\u4e91\u670d\u52a1\uff0c\u5305\u62ecserverless lambada\u548cAmszon IoT\uff0c\u6240\u4ee5\u6700\u8fd1\u52a0\u4e0a\u4e86\u8fd9\u5757\u7684\u5b66\u4e60,\u4e4b\u524d\u505a\u8fc7\u56fd\u5185\u7684\u963f\u91cc\u4e91\u4e00\u5957\u548c\u7535\u4fe1IoT\u5e73\u53f0\uff0c\u73b0\u5728\u5207\u6362\u6210\u4e9a\u9a6c\u900a\u8fd9\u5757\u7740\u5b9e\u72af\u4e86\u96be\u3002<\/p>\n<ul>\n<li>\u6ce8\u518c\u8d26\u53f7\u8981\u7ed1\u5b9a\u4e00\u5f20\u56fd\u5916\u7684\u5361\uff08\u94f6\u884c\u5361\u6216\u4fe1\u7528\u5361\uff09<\/li>\n<li>\u914d\u7f6e\u9ebb\u70e6\uff08\u611f\u89c9\u6bd4\u56fd\u5185\u9ebb\u70e6\u4e86\u4e0d\u662f\u4e00\u661f\u534a\u70b9\uff09<\/li>\n<li>\u6ca1\u6709\u6559\u7a0b\uff0c\u7f51\u4e0a\u5f88\u96be\u627e\u8fc7\u8fd9\u4e9b\u670d\u52a1\u7684\u5b8c\u6574\u6559\u7a0b<br \/>\n<h1>serverless lambada<\/h1>\n<p>\u4e0b\u9762\u5206\u4e3a\u51e0\u79cd\u65b9\u5f0f\u5f00\u53d1\u8fde\u63a5\uff0c\u90fd\u7ed9\u51fa\u5177\u4f53\u5f00\u53d1\u8fde\u63a5\u793a\u4f8b\uff0c\u65e0\u8bba\u5982\u4f55\u90fd\u9700\u8981\u5148\u5b89\u88c5\u6307\u5b9a\u63d2\u4ef6\uff0c\u652f\u6301\u4e0b\u4e00\u6b65\u5f00\u53d1\u5de5\u4f5c<br \/>\n\u63d2\u4ef6\u5730\u5740\uff1a<a href=\"https:\/\/docs.aws.amazon.com\/zh_cn\/toolkit-for-jetbrains\/latest\/userguide\/welcome.html\" title=\"\u63d2\u4ef6\">\u63d2\u4ef6<\/a><br \/>\n\u7279\u522b\u63d0\u793a\uff0c\u5b89\u88c5\u65f6\u9700\u8981\u7ffb\u5899<\/p>\n<h2>java\u7248<\/h2>\n<h3>\u5b89\u88c5\u65b9\u5f0f\uff1a<\/h3>\n<p>\u4e00\u3001\u5b98\u7f51\u4e0a\u627e\u5230\u5b89\u88c5\u5de5\u5177\u5305<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/toolkit-for-jetbrains\/latest\/userguide\/setup-toolkit.html\">https:\/\/docs.aws.amazon.com\/toolkit-for-jetbrains\/latest\/userguide\/setup-toolkit.html<\/a><br \/>\n\u4f4d\u7f6eidea-&gt;settings-&gt;plugin<br \/>\n\u5728Marketplace\u9009\u9879\u5361\u4e0a\u7684Search plugins in marketplace\u4e2d\uff0c\u5f00\u59cb\u8f93\u5165AWS Toolkit<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/find-plugin.png\" alt=\"\" \/><br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\u91cd\u542f<br \/>\n\u4e8c\u3001\u5b89\u88c5AWS CLI<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html\">https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html<\/a><br \/>\n\u627e\u5230\u9002\u5408\u81ea\u5df1\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u4e0b\u8f7d\u5e76\u5b89\u88c5<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677509895413.png\" alt=\"\" \/><br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\u6253\u5f00cmd\uff0c\u6267\u884c\u547d\u4ee4\u68c0\u8f66\u662f\u5426\u5b89\u88c5\u6210\u529f\uff0c\u5982\u4e0b\u4fbf\u662f\u5b89\u88c5\u6210\u529f\u4e86<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677510031213.png\" alt=\"\" \/><br \/>\n\u4e09\u3001\u5b89\u88c5docker\u73af\u5883,\u771f\u591f\u590d\u6742\u7684<br \/>\n<a href=\"https:\/\/docs.docker.com\/desktop\/install\/windows-install\/\">https:\/\/docs.docker.com\/desktop\/install\/windows-install\/<\/a><br \/>\n\u8fd9\u91cc\u6839\u636e\u81ea\u5df1\u7684\u7cfb\u7edf\u5b89\u88c5\uff0c\u6211\u7684\u662fwindows\u7684\uff0c\u4e0b\u81ea\u5df1\u5bf9\u5e94\u7248\u672c\u5373\u53ef<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677510893243.png\" alt=\"\" \/><br \/>\n\u4e0b\u8f7d\u597d\u540e\u53cc\u51fb\u5f00\u59cb\u5b89\u88c5<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677511163378.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677511181838.png\" alt=\"\" \/><br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\u684c\u9762\u4e0a\u5e94\u8be5\u591a\u4e86\u4e00\u4e2a\u56fe\u6807<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677511371350.png\" alt=\"\" \/><br \/>\n\u8fd9\u6837\u8868\u793a\u5b89\u88c5\u6210\u529f\uff0c\u4f46\u662f<strong>\u5343\u4e07\u5343\u4e07\u6ce8\u610f<\/strong>\uff0c\u4e0d\u8981\u70b9\u51fb\u5f39\u51fa\u7684\u7acb\u5373\u5173\u95ed\uff0c\u5426\u5219\u7535\u8111\u4f1a\u91cd\u542f\u3002\u6ce8\u610f\u4fdd\u5b58\u597d\u81ea\u5df1\u7684\u4efb\u52a1\u518d\u70b9\u51fb\u5173\u95ed\u3002\u91cd\u542f\u540e\u53ef\u80fd\u4f1a\u51fa\u73b0\u4e00\u4e9b\u5176\u4ed6\u95ee\u9898\uff0c\u6bd4\u5982\u8981\u6c42\u5347\u7ea7wsl\u7684\u78b0\u5230\u4e86\u81ea\u884c\u767e\u5ea6<br \/>\n\u56db\u3001\u5b89\u88c5AWS SAM CLI<br \/>\n<a href=\"https:\/\/docs.aws.amazon.com\/serverless-application-model\/latest\/developerguide\/install-sam-cli.html\">https:\/\/docs.aws.amazon.com\/serverless-application-model\/latest\/developerguide\/install-sam-cli.html<\/a><br \/>\n\u540c\u6837\u9009\u62e9\u81ea\u5df1\u5bf9\u5e94\u7684\u7248\u672c\u4e0b\u8f7d\u5b89\u88c5<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/1677510496828.png\" alt=\"\" \/><br \/>\n\u5b89\u88c5\u6210\u529f\u540ecmd\u8f93\u5165sam &#8211;version\u51fa\u73b0\u5982\u4e0b\u754c\u9762\u5373\u8868\u793a\u5b89\u88c5\u6210\u529f<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775524414366.png\" alt=\"\" \/><br \/>\n\u4e94\u3001\u6253\u5f00idea\u914d\u7f6e\u79d8\u94a5<br \/>\n\u9996\u5148\u70b9\u51fb\u5982\u4e0b\u4f4d\u7f6e\uff0c\u6211\u7684\u5fe7\u90c1\u914d\u7f6e\u597d\u4e86\uff0c\u8ddf\u4f60\u7684\u4e0d\u4e00\u6837\uff0c\u4f60\u7684\u5e94\u8be5\u662fselect xxxx\u4e4b\u7c7b\u7684\uff0c\u4e00\u822c\u5728idea\u53f3\u4e0b\u89d2\u4f4d\u7f6e<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_167756063019.png\" alt=\"\" \/><br \/>\n\u7136\u540e\u8fdb\u884c\u586b\u5165\u83b7\u53d6\u5230\u7684aws_access_key_id\u548caws_secret_access_key\u5982\u4e0b<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775607072898.png\" alt=\"\" \/><br \/>\n\u5f53\u5982\u4e0a\u6240\u793a\u76841,2\u4f4d\u7f6e\u586b\u5165\u540e\uff0c\u4fdd\u5b58\u65f6\u4f1a\u81ea\u52a8\u51fa\u73b0\u59823\u7684\u5185\u5bb9\uff0c\u8fd9\u65f6\u5019\u8868\u793a\u6211\u4eec\u5df2\u7ecf\u8fde\u63a5\u4e0a\u4e86\uff0c\u53ef\u4ee5\u8fdb\u884c\u4ee3\u7801\u5b9e\u6218\u4e86\u3002<br \/>\n\u65e2\u7136\u6240\u6709\u7684\u8981\u6c42\u90fd\u7b26\u5408\u4e86\uff0c\u6211\u4eec\u5f00\u59cb\u7b2c\u4e00\u4e2ahello world\u7a0b\u5e8f\u6f14\u793a\u5427<\/p>\n<h3>\u793a\u4f8b\u4ee3\u7801<\/h3>\n<p>\u4e00\u3001\u65b0\u5efa\u4e00\u4e2aserverless\u5de5\u7a0b<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775620235641.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775620571893.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775621152030.png\" alt=\"\" \/><br \/>\n\u70b9\u51fb\u521b\u5efa\uff0c\u7b49\u5f85\u7cfb\u7edf\u521d\u59cb\u5316\u5b8c\u6210\uff0c\u6b63\u5e38\u7684\u521d\u59cb\u5316\u540e\u5e94\u8be5\u5305\u542b\u5982\u4e0b3\u4e2a\u90e8\u5206<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_1677562348928.png\" alt=\"\" \/><br \/>\n\u793a\u4f8b\u5982\u4e0b<br \/>\n\u9ed8\u8ba4\u65b0\u5efa\u7684\u9879\u76ee\u5df2\u7ecf\u4e3a\u6211\u4eec\u5199\u597d\u4e86\u6700\u7b80\u5355\u7684\u4ee3\u7801\uff0c\u70b9\u51fb\u5982\u4e0b\u4f4d\u7f6e\u9009\u62e9\u8fd0\u884c<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775667128520.png\" alt=\"\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775667799666.png\" alt=\"\" \/><br \/>\n\u5f53\u786e\u5b9a\u540e\u7b2c\u4e00\u6b21\u6267\u884c\u65f6\u95f4\u6bd4\u8f83\u957f\uff0c\u7cfb\u7edf\u9700\u8981\u6784\u5efa\u597d\u9879\u76ee\uff0c\u5e76\u4e14\u62c9\u53d6\u955c\u50cf\u548c\u521b\u5efa\u955c\u50cf\u6267\u884c<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16775669951900.png\" alt=\"\" \/><\/p>\n<h3>\u53d1\u5e03<\/h3>\n<p>\u53d1\u5e03\u65b9\u6cd5\u5982\u4e0b<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<h2>nodejs\u7248<\/h2>\n<h3>\u5b89\u88c5\u65b9\u5f0f\uff1a<\/h3>\n<p>\u4e00\u3001\u8bf4\u660e<br \/>\n\u5982\u679c\u4f7f\u7528\u7684\u662fwebstorm,\u90a3\u4e48\u5b89\u88c5\u65b9\u5f0f\u540cidea<\/p>\n<h3>\u793a\u4f8b\u4ee3\u7801<\/h3>\n<p>\u793a\u4f8b\u5982\u4e0b<\/p>\n<h3>\u53d1\u5e03<\/h3>\n<p>\u53d1\u5e03\u65b9\u6cd5\u5982\u4e0b<\/p>\n<hr \/>\n<h2>python\u7248<\/h2>\n<h3>\u5b89\u88c5\u65b9\u5f0f\uff1a<\/h3>\n<p>\u4e00\u3001\u8bf4\u660e<br \/>\n1.\u5b89\u88c5AWS CLI\u548c\u5b89\u88c5docker\u53c2\u770bjava\u5b89\u88c5\u7684\u7b2c\u4e8c\u3001\u4e09\u6b65\u9aa4\uff0c\u540c\u6837\u5b89\u88c5\u63d2\u4ef6aws toolkit\u4e5f\u53c2\u770bjava\u7684\u5b89\u88c5\u65b9\u5f0f<br \/>\n2.\u76ee\u524dlambda\u652f\u6301\u7684\u6700\u9ad8python\u7248\u672c\u4e3a3.9\uff0c\u6240\u4ee5\u4e0b\u8f7d\u7684\u65f6\u5019\u6ce8\u610f<br \/>\n\u4e8c\u3001\u5b89\u88c5\u63d2\u4ef6BashSupport pro<br \/>\n\u5f53\u7136\u4e5f\u53ef\u4ee5\u4e0d\u7528\u5b89\u88c5\uff0c\u76f4\u63a5\u4f7f\u7528sam\u547d\u4ee4\u4e5f\u53ef\u4ee5\uff0c\u770b\u4e2a\u4eba\u5427\uff0c\u611f\u89c9\u6709\u754c\u9762\u8fd8\u662f\u6bd4\u8f83\u65b9\u4fbf<br \/>\n\u4e09\u3001\u5b89\u88c5python-lambda-local<br \/>\n\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5<\/p>\n<pre><code class=\"language-python\">pip install python-lambda-local<\/code><\/pre>\n<p>\u53e6\u5916\u56e0\u4e3a\u8981\u7528aws lambda,\u6240\u4ee5\u4e00\u5e76\u628aboto3\u4e00\u8d77\u5b89\u88c5\u4e86\uff0cboto3\u662faws lambda\u7684\u4e3b\u8981\u5f00\u53d1\u5de5\u5177\u7c7b<\/p>\n<pre><code class=\"language-python\">pip install boto3<\/code><\/pre>\n<p>\u56db\u3001\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b\u9879\u76ee<br \/>\n1.\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u521d\u59cb\u5316\u4e00\u4e2a\u6d4b\u8bd5\u9879\u76ee,\u5e76\u4f9d\u6b64\u586b\u5199\u76f8\u5173\u5185\u5bb9<\/p>\n<pre><code class=\"language-python\">sam init<\/code><\/pre>\n<p>\u521d\u59cb\u5316\u5b8c\u6210\u540e\u53bb\u5230\u76ee\u5f55\u4e0b\u67e5\u770b<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16777377541920.png\" alt=\"\" \/><br \/>\n2.\u914d\u7f6e\u542f\u52a8\u53c2\u6570<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16777372646623.png\" alt=\"\" \/><br \/>\n3.\u521b\u5efa\u4e00\u4e2a\u672c\u5730\u7684lambda\u8c03\u8bd5\u5e94\u7528<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_1677737339996.png\" alt=\"\" \/><br \/>\n4.\u914d\u7f6e\u53c2\u6570<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16777375358099.png\" alt=\"\" \/><br \/>\n5.\u542f\u52a8<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16777378246387.png\" alt=\"\" \/><br \/>\n\u7b49\u5f85\u9879\u76ee\u8dd1\u8d77\u6765\u4ee3\u8868\u6210\u529f\uff0c\u7b2c\u4e00\u6b21\u9700\u8981\u53bbdocker\u62c9\u53d6\u955c\u50cf\u6bd4\u8f83\u6162\uff0c\u770b\u63a7\u5236\u53f0\u7684\u8f93\u51fa\u53ef\u4ee5\u5224\u65ad\u6267\u884c\u5230\u8bf4\u660e\u5730\u65b9\u3002<\/p>\n<h3>\u793a\u4f8b\u4ee3\u7801<\/h3>\n<p>\u793a\u4f8b\u5982\u4e0b\u6839java\u7684\u5176\u5b9e\u5dee\u4e0d\u591a<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wqeq.com\/wp-content\/uploads\/2023\/02\/WXWorkCapture_16777381474036.png\" alt=\"\" \/><\/p>\n<h3>\u53d1\u5e03<\/h3>\n<p>\u53d1\u5e03\u65b9\u6cd5\u5982\u4e0b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5165\u804c\u7684\u516c\u53f8\u9700\u8981\u4f7f\u7528\u4e9a\u9a6c\u900a\u7684\u4e91\u670d\u52a1\uff0c\u5305\u62ecserverless lambada\u548cAmszon IoT\uff0c\u6240\u4ee5\u6700\u8fd1 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[67,66],"_links":{"self":[{"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/posts\/18628"}],"collection":[{"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18628"}],"version-history":[{"count":14,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/posts\/18628\/revisions"}],"predecessor-version":[{"id":18679,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=\/wp\/v2\/posts\/18628\/revisions\/18679"}],"wp:attachment":[{"href":"https:\/\/www.wqeq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wqeq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}