\nAmazonS3FullAccess<\/td>\n | S3\u30d0\u30b1\u30c3\u30c8\u3078\u306e\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u3055\u3089\u306b\u52d5\u4f5c\u78ba\u8a8d\u7528\u306e\u30ed\u30b0\u3092\u51fa\u529b\u3059\u308b\u305f\u3081\u3001 AWSLambdaBasicExecutionRole<\/code>\u3082\u4ed8\u4e0e\u3057\u307e\u3057\u305f\u3002<\/p>\n\u8a2d\u5b9a\u753b\u9762\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n <\/p>\n VPC\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306e\u8a2d\u5b9a<\/h3>\n\u7d9a\u3044\u3066\u3001Lambda\u95a2\u6570\u3068EFS\u3092\u9023\u643a\u3055\u305b\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u9032\u3081\u307e\u3059\u3002 \nLambda\u95a2\u6570\u306e\u74b0\u5883\u306bEFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u30a2\u30bf\u30c3\u30c1\u3059\u308b\u305f\u3081\u306b\u306f\u3001Lambda\u95a2\u6570\u3092EFS\u3068\u540c\u3058VPC\u306b\u914d\u5099\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\uff08Lambda\u95a2\u6570\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u300c\u975eVPC\u300d\u306b\u914d\u5099\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u3067\u306fEFS\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\uff09 \n\u5408\u308f\u305b\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u3082\u8a2d\u5b9a\u3057\u3066\u3001EFS\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306b\u3066NFS\u30a2\u30af\u30bb\u30b9\u304c\u8a31\u53ef\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \n\u4ee5\u4e0a\u306e\u8a2d\u5b9a\u3092\u753b\u9762\u3067\u898b\u308b\u3068\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n <\/p>\n \u3055\u3089\u306b\u3001EFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u3001\u4eca\u56de\u4f5c\u6210\u3057\u305f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30b0\u30eb\u30fc\u30d7\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001Lambda\u95a2\u6570\u304b\u3089EFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3078\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n \u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u8a2d\u5b9a<\/h3>\n\u7d9a\u3044\u3066\u3001Lambda\u74b0\u5883\u306b\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u30de\u30a6\u30f3\u30c8\u3059\u308b\u4f5c\u696d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n \u300c1. EFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3059\u308b\u300d\u3092\u884c\u3063\u305f\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u300c\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u8ffd\u52a0\u300d\u753b\u9762\u3067\u3001\u300cEFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u300d\u3068\u300c\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u300d\u304c\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u300c\u30ed\u30fc\u30ab\u30eb\u30de\u30a6\u30f3\u30c8\u30d1\u30b9\u300d\u6b04\u3067\u3001Lambda\u74b0\u5883\u306e\u3069\u306e\u30d1\u30b9\u306bEFS\u3092\u30de\u30a6\u30f3\u30c8\u3059\u308b\u304b\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n \n\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u8a2d\u5b9a\u306f\u3001\u6b21\u306e\u300c\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u300d\u753b\u9762\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n
<\/p>\n \u4ee5\u4e0a\u306e\u4f5c\u696d\u3067\u3001Lambda\u74b0\u5883\u306e\/mnt\/test<\/code>\u306e\u30d1\u30b9\u306b\u3001EFS\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304c\u30de\u30a6\u30f3\u30c8\u3055\u308c\u305f\u72b6\u614b\u3001\u3059\u306a\u308f\u3061Lambda\u95a2\u6570\u3068EFS\u304c\u9023\u643a\u3057\u305f\u72b6\u614b\u3092\u5b9f\u73fe\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n6. Lambda\u95a2\u6570\u3067\u3001EFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30c7\u30fc\u30bf\u3092S3\u30d0\u30b1\u30c3\u30c8\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/h2>\n\u6700\u5f8c\u306b\u3001Lambda\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u5b9f\u73fe\u3057\u305f\u3044\u3053\u3068\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n \n- Lambda\u74b0\u5883\u306b\u9023\u643a\u3057\u305fEFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\/mnt\/test\/\u914d\u4e0b\u3092\u5bfe\u8c61\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b<\/li>\n
- \u5404\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066\u3001\u62e1\u5f35\u5b50\u304b\u3089ContentType\u3092\u6c7a\u5b9a\u3059\u308b<\/li>\n
- \u30d5\u30a1\u30a4\u30eb\u3092EFS\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304b\u3089S3\u30d0\u30b1\u30c3\u30c8\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b<\/li>\n<\/ul>\n
\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n import os\nimport boto3\nimport glob\n\n\ndef lambda_handler(event, context):\n file_lists_s3copy()\n return\n\n\ndef file_lists_s3copy():\n # get file list in \/mnt\/test\/\n files = glob.glob("\/mnt\/test\/**", recursive=True)\n s3 = boto3.client('s3')\n for file in files:\n print(file)\n filename = file.replace('\/mnt\/test\/', '')\n print(filename)\n root, extension = os.path.splitext(filename)\n print(extension)\n\n if extension == ".html":\n type = 'text\/html'\n type_f = True\n elif extension == ".css":\n type = 'text\/css'\n type_f = True\n elif extension == ".js":\n type = 'application\/javascript'\n type_f = True\n else:\n type = 'text\/plain'\n type_f = False\n\n if os.path.isfile(file):\n s3copy(file, filename, type, type_f, s3)\n return\n\n\ndef s3copy(file_path, file_name, type, type_f, s3):\n if type_f:\n s3.upload_file(file_path, '<S3\u30d0\u30b1\u30c3\u30c8\u540d\u3092\u3053\u3053\u306b\u8a18\u8f09\u3002\u4eca\u56de\u306f`\u301c\u301c\u301c\u301ctest.mmmcorp.co.jp`>',\n file_name, ExtraArgs={'ContentType': type})\n else:\n s3.upload_file(\n file_path, '<S3\u30d0\u30b1\u30c3\u30c8\u540d\u3092\u3053\u3053\u306b\u8a18\u8f09\u3002`\u301c\u301c\u301c\u301ctest.mmmcorp.co.jp`>', file_name)\n return\n<\/code><\/pre>\n\u4e00\u9023\u306e\u4f5c\u696d\u306b\u3088\u3063\u3066\u3001\u4eca\u56de\u306e\u30b4\u30fc\u30eb\u3067\u3042\u308b\u300c\u9759\u7684\u5316\u3057\u305fWordPress\u30b5\u30a4\u30c8\u3092\u3001AWS Lambda\u306eEFS\u9023\u643a\u3092\u7528\u3044\u3066S3\u306b\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u300d\u3053\u3068\u306f\u3001\u5b9f\u969b\u306b\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u304c\u691c\u8a3c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n \u3055\u3089\u306b\u3001CloudWatchEvents\u30eb\u30fc\u30eb\u306a\u3069\u3067Lambda\u95a2\u6570\u3092\u5b9a\u671f\u5b9f\u884c\u3059\u308b\u8a2d\u5b9a\u3092\u884c\u3048\u3070\u3001EFS\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5b9a\u671f\u7684\u306bS3\u30d0\u30b1\u30c3\u30c8\u306b\u53cd\u6620\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n AWS Lambda\u306eEFS\u9023\u643a\u306e\u691c\u8a3c\u306e\u632f\u308a\u8fd4\u308a<\/h2>\n\u4eca\u56de\u306e\u691c\u8a3c\u3067\u306f\u3001\u65b0\u6a5f\u80fd\u3067\u3042\u308bAWS Lambda\u306eEFS\u9023\u643a\u3092\u7528\u3044\u3066\u3001\u9759\u7684\u5316\u3057\u305fWordPress\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u3001S3\u30d0\u30b1\u30c3\u30c8\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u65b9\u5f0f\u3092\u5b9f\u73fe\u3057\u307e\u3057\u305f\u3002<\/p>\n \u5f93\u6765\u306e\u65b9\u5f0f\u3067\u306f\u3001\u8907\u6570\u306eEC2\u304b\u3089S3\u30d0\u30b1\u30c3\u30c8\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u51e6\u7406\u3092\u884c\u304a\u3046\u3068\u3059\u308b\u3068\u3001\u540c\u3058\u51e6\u7406\u3092\u91cd\u8907\u3057\u3066\u884c\u3046\u3053\u3068\u306b\u306a\u308a\u30e0\u30c0\u306a\u8ee2\u9001\u3082\u767a\u751f\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n \u3053\u308c\u3092\u9632\u3050\u305f\u3081\u30011\u53f0\u306eEC2\u3060\u3051\u306bAWS CLI\u306b\u3088\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u305f\u308a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u69cb\u6210\u3060\u3068\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u51e6\u7406\u3092\u8a2d\u5b9a\u3057\u305fEC2\u304c\u5358\u4e00\u969c\u5bb3\u70b9\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u3001\u4e07\u304c\u4e00\u306e\u3068\u304d\u306e\u305f\u3081\u306e\u4f53\u5236\u304c\u3067\u304d\u3066\u3044\u306a\u3044\u72b6\u614b\u3067\u3057\u305f\u3002<\/p>\n \u3053\u306e\u69cb\u6210\u3092\u6b21\u306e\u56f3\u306b\u3059\u308b\u3068\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n <\/p>\n \u4eca\u56de\u691c\u8a3c\u3057\u305f\u65b9\u5f0f\u3067\u306f\u3001Lambda\u95a2\u6570\u306e\u51e6\u7406\u306b\u3088\u3063\u3066EFS\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u51fa\u3057\u3001S3\u3078\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u51e6\u7406\u304c\u3067\u304d\u308b\u3088\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n <\/p>\n \u3053\u306e\u69cb\u6210\u306b\u306f\u3001\u5f93\u6765\u306e\u69cb\u6210\u306b\u6bd4\u3079\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n \n- EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u306a\u304fAWS\u306e\u30de\u30cd\u30fc\u30b8\u30c9\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u51e6\u7406\u3092\u7f6e\u304f\u3053\u3068\u3067\u3001\u51e6\u7406\u306e\u5197\u9577\u5316\u3092\u5b9f\u73fe\u3067\u304d\u308b<\/li>\n
- EC2\u3067\u306e\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3084\u30ed\u30fc\u30eb\u306e\u8a2d\u5b9a\u3092\u7121\u304f\u3057\u3001\u6700\u5c0f\u6a29\u9650\u306b\u3067\u304d\u308b<\/li>\n
- \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u51e6\u7406\u304cEC2\u306e\u30e1\u30e2\u30ea\u4e0d\u8db3\u306a\u3069\u306e\u5f71\u97ff\u3092\u53d7\u3051\u305a\u306b\u6e08\u307f\u3001\u78ba\u5b9f\u306a\u5b9a\u671f\u5b9f\u884c\u304c\u53ef\u80fd\u306b\u306a\u308b<\/li>\n
- \u500b\u5225\u306b\u5b9f\u88c5\u3057\u3066\u3044\u305f\u51e6\u7406\u3092AWS\u306e\u30de\u30cd\u30fc\u30b8\u30c9\u30b5\u30fc\u30d3\u30b9\u306b\u4efb\u305b\u308b\u3053\u3068\u3067\u3001\u30af\u30e9\u30a6\u30c9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u6069\u6075\u3092\u53d7\u3051\u3089\u308c\u308b<\/li>\n<\/ul>\n
\u4eca\u56de\u306e\u8a18\u4e8b\u304c\u3001AWS Lambda\u306eEFS\u9023\u643a\u6d3b\u7528\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u306f\u3058\u3081\u306b \u65e5\u672c\u6642\u9593\u306e6\u670817\u65e5\uff08\u6c34\uff09\u3001AWS\u3088\u308aAWS Lambda\u304cAmazon Elastic File System\uff08EFS\uff09\u306b\u5bfe\u5fdc\u3057\u305f\u3068\u3044\u3046\u65b0\u6a5f\u80fd\u306e\u30ea\u30ea\u30fc\u30b9\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u3002 AWS Lambda support for Amazon Elastic File System now generally available AWS Lambda customers can now enabl […]<\/p>\n","protected":false},"author":6,"featured_media":684,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,21],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/647"}],"collection":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/comments?post=647"}],"version-history":[{"count":0,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/647\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media?parent=647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/categories?post=647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/tags?post=647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
|