{"id":2849,"date":"2019-08-26T16:38:40","date_gmt":"2019-08-26T07:38:40","guid":{"rendered":"http:\/\/anada.cloudfree.jp\/?p=2849"},"modified":"2019-08-27T18:06:01","modified_gmt":"2019-08-27T09:06:01","slug":"aws%e8%a6%9a%e6%9b%b8-lambda%e9%96%a2%e6%95%b0%e3%82%92%e4%bd%9c%e3%82%8b%ef%bd%9ealexa-sdk-for-node-js-version2","status":"publish","type":"post","link":"http:\/\/anada.cloudfree.jp\/?p=2849","title":{"rendered":"AWS\u899a\u66f8 Lambda\u95a2\u6570\u3092\u4f5c\u308b(1)\uff5eAlexa SDK for Node.js v2"},"content":{"rendered":"<p>\u3044\u3064\u306e\u9593\u306b\u304bVersion2\u304c\u51fa\u3066\u305f\u3002<br \/>\nalexa-sdk\u304b\u3089ask-sdk\u306b\u5909\u308f\u3063\u3066\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u5bfe\u5fdc\u3057\u305fLambda\u95a2\u6570\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u306e\u3060\u304c\u3001SDK\u3092\u53d6\u5f97\u3059\u308b\u306e\u306b\u76f8\u5909\u308f\u3089\u305aLinux\u74b0\u5883\u304c\u8981\u308b\u306e\u3060\u3002<br \/>\n\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3088\u3049\uff5e\u306a\u3069\u3068\u3044\u3046\u8b33\u3044\u6587\u53e5\u3068\u306f\u88cf\u8179\u306b\u9762\u5012\u306a\u306e\u3060\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u666e\u6bb5Linux\u3092\u4f7f\u3046\u3053\u3068\u306e\u306a\u3044\u79c1\u306b\u3068\u3063\u3066\u306f\u300c\u3044\u3044\u52c9\u5f37\u3060\u300d\u306a\u3069\u3068\u534a\u5206\u81ea\u5206\u306b\u5618\u3092\u3064\u304d\u306a\u304c\u3089\u3001SDK\u3092\u53d6\u5f97\u3057\u3066\u307f\u305f\u3002<br \/>\nLinux\u306e\u74b0\u5883\u306fAWS EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u7528\u610f\u3002<br \/>\nAWS\u306eEC2\uff08Amazon Linux\uff09\u304c\u4fbf\u5229\u306a\u3068\u3053\u308d\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u30b3\u30de\u30f3\u30c9\u304c\u6253\u3066\u308b\u70b9\u3060\u3002\u6c17\u304c\u5229\u3044\u3066\u3044\u308b\u3002<br \/>\n\uff08\u3068\u306f\u3044\u3046\u3082\u306e\u306e\u3001\u30d6\u30e9\u30a6\u30b6\u3092\u653e\u7f6e\u3057\u3066\u3044\u308b\u3068\u3001\u30b3\u30de\u30f3\u30c9\u304c\u6253\u3066\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u4e0d\u5177\u5408\u306a\u306e\u304b\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u5207\u308c\u306a\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u73fe\u8c61\u304c\u8d77\u3053\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3002\uff09<\/p>\n<p>\u8d77\u52d5\u3057\u305f\u3089\u3001npm\u307e\u3067\u5165\u3063\u3066\u306a\u3044\u30fb\u30fb\u30fb\u30c8\u30db\u30db\u3002<br \/>\n\u3057\u3087\u3046\u304c\u306a\u3044\u304b\u3089\u3044\u308d\u3044\u308d\u5165\u308c\u308b\u3053\u3068\u306b\u3002<br \/>\n\u203b\u3053\u3053\u304b\u3089\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u4e0a\u8a18\u306e\u901a\u308aEC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9(Amazon Linux)\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u4f8b\u3002<\/p>\n<dl>\n<dt>\n<h4>NodeBrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<\/dt>\n<dd>\nNodeBrew\u306fNode.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u5207\u66ff\u7528\u30c4\u30fc\u30eb\u3089\u3057\u3044\u3002\u305d\u3057\u3066\u3001NodeBrew\u3092\u4f7f\u3063\u3066Node.js\u306e\u3044\u308d\u3093\u306a\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u53d6\u5f97\u3057\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u5207\u66ff\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u306e\u3067\u3042\u308b\u3002<br \/>\n\u3059\u3054\u3044\u306a\u3041\u30fb\u30fb\u30fb\u306a\u3069\u3068\u611f\u5fc3\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\ncurl -L git.io\/nodebrew | perl - setup\r\nexport PATH=$HOME\/.nodebrew\/current\/bin:$PATH\r\nsource ~\/.bashrc\r\nnodebrew help\r\n<\/pre>\n<p>\u3067\u3001NodeBrew\u306e\u30d8\u30eb\u30d7\u304c\u898b\u3089\u308c\u305f\u3089\u3001NodeBrew\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3002\u3053\u308c\u3067npm\u3082\u5165\u308b\u3002\n<\/dd>\n<dt>\n<h4>Node.js\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<\/dt>\n<dd>\n\u3053\u3053\u3067\u306fversion8\u3067\u5229\u7528\u4e88\u5b9a\u306eversion8.10.*\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3046\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nnodebrew install v8.10\r\nnodebrew use v8.10\r\nnode -v\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u30018.10\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u3046\u3088\uff01\u3068\u5ba3\u8a00\u5f8c\u3001node\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305fNode.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3002\n<\/dd>\n<dt>\n<h4>ask-sdk\u3092npm\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<\/dt>\n<dd>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nnpm install ask-sdk\r\nnpm install ask-sdk-v1adapter\r\nnpm install ask-sdk-core\r\nnpm uninstall aws-sdk\r\n<\/pre>\n<p>\u4e0a\u306f\u4f8b\u3002\u8981\u3089\u306a\u3044\u3082\u306e\u306f\u5165\u308c\u306a\u304f\u3066\u3044\u3044\u3002\u53d6\u5f97\u3057\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3059\u3079\u3066node_modules\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u5165\u308b\u3002<br \/>\nAWS-SDK\u304c\u3042\u308b\u3068\u5bb9\u91cf\u304c\u5897\u3048\u3066Lambda\u95a2\u6570\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3067\u304d\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u524a\u9664\u3057\u3066\u304a\u304f\u3053\u3068\u3002\n<\/dd>\n<dt>\n<h4>ask-sdk\u3092Zip\u5727\u7e2e\u5f8c\u3001S3\u3078\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/h4>\n<\/dt>\n<dd>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\ncd .\/\r\nzip -r alexa_ask_sdk.zip node_modules\r\n<\/pre>\n<p>\u4e0a\u306e\u968e\u5c64\u306b\u884c\u3063\u3066\u3001node_modules\u30d5\u30a9\u30eb\u30c0\u3092\u4e38\u3054\u3068ZIP\u5727\u7e2e\u3002<br \/>\nZip\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u3068\u304d\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bless\u6587\u3092\u4f7f\u3046\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nless alexa_ask_sdk.zip\r\n<\/pre>\n<p>(\u30b3\u30de\u30f3\u30c9\u7d42\u4e86\u306f:q)<\/p>\n<p>\u6b21\u306fS3\u3078\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3002\u3053\u308c\u306fAWS CLI\u3092\u4f7f\u3046\u3002<br \/>\n{****}\u306f\u30d0\u30b1\u30c3\u30c8\u540d\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\naws s3 cp alexa_ask_sdk.zip s3:\/\/{****}\/alexa.zip\r\n<\/pre>\n<\/dd>\n<\/dl>\n<p>S3\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305fzip\u3092Lambda\u95a2\u6570\u306e\u95a2\u6570\u30b3\u30fc\u30c9\u306e\u3068\u3053\u308d\u3067\u53d6\u308a\u8fbc\u3081\u3070\u3001\u3088\u3046\u3084\u304f\u30b3\u30fc\u30c9\u306e\u7de8\u96c6\u304c\u59cb\u3081\u3089\u308c\u308b\u3002<br \/>\n\u7d9a\u304d\u306f(2)\u3078\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u3064\u306e\u9593\u306b\u304bVersion2\u304c\u51fa\u3066\u305f\u3002 alexa-sdk\u304b\u3089ask-sdk\u306b\u5909\u308f\u3063\u3066\u305f\u3002 \u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u5bfe\u5fdc\u3057\u305fLambda\u95a2\u6570\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3063\u305f\u306e\u3060\u304c\u3001SDK\u3092\u53d6\u5f97\u3059\u308b\u306e\u306b\u76f8\u5909\u308f\u3089\u305aLinux\u74b0\u5883\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195,196],"tags":[],"class_list":["post-2849","post","type-post","status-publish","format-standard","hentry","category-aws","category-node-js"],"_links":{"self":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2849"}],"version-history":[{"count":12,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2849\/revisions"}],"predecessor-version":[{"id":2889,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/2849\/revisions\/2889"}],"wp:attachment":[{"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2849"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/anada.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}