{"id":10933,"date":"2023-02-01T10:11:56","date_gmt":"2023-02-01T01:11:56","guid":{"rendered":"https:\/\/www.stuffy.site\/computers\/?p=10933"},"modified":"2023-02-01T10:11:56","modified_gmt":"2023-02-01T01:11:56","slug":"%e3%81%b7%e3%81%a1%e3%82%b9%e3%82%bf%e3%83%87%e3%82%a3aws-s3%e3%83%90%e3%82%b1%e3%83%83%e3%83%88%e3%83%9d%e3%83%aa%e3%82%b7%e3%83%bc%e3%81%ae%e7%b7%a8%e9%9b%86","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/computers\/archives\/10933","title":{"rendered":"\u3077\u3061\u30b9\u30bf\u30c7\u30a3@AWS S3\u30d0\u30b1\u30c3\u30c8\u30dd\u30ea\u30b7\u30fc\u306e\u7de8\u96c6"},"content":{"rendered":"\n<p>AWSElasticBeanstalk\u74b0\u5883\u3067Node.js\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3001S3\u30d0\u30b1\u30c3\u30c8\u3078\u306e\u63a5\u7d9a\u3092\u3057\u305f\u3068\u3053\u308d\u3001Error Access Denied \u3068\u306a\u308a\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002\u63a5\u7d9a\u3059\u308b\u306b\u306f\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306e\u307b\u304b\u306b\u30d0\u30b1\u30c3\u30c8\u30dd\u30ea\u30b7\u30fc\u3092\u9069\u5207\u306b\u8a31\u53ef\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<!--more-->\n\n\n<h2 style=\"color:#0000ff\">\u3072\u3068\u9803\u6d41\u884c\u3063\u305f\u300c\u30a2\u30a4\u30b9\u30d0\u30b1\u30c4\u30c1\u30e3\u30ec\u30f3\u30b8\u300d\u3068\u306f\u3053\u306e\u3053\u3068\u3060\u3063\u305f\u306e\u304b\u30fb\u30fb\u30fb\u30fb\u3002<\/h2>\n\n\n<p>\u5197\u8ac7\u306f\u3055\u3066\u304a\u304d\u3001AWS\u306e\u30b9\u30c8\u30ec\u30fc\u30b8PaaS\u3068\u3057\u3066\u300cS3\u300d\u304c\u7121\u6599\u30c8\u30e9\u30a4\u30a2\u30eb\u3067\u5229\u7528\u53ef\u80fd\u3060\u3063\u305f\u306e\u3067\u30c6\u30ad\u30b9\u30c8\u306e\u901a\u308a\u3001\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u3092 [ElasticBeanstalk] &#8211; [\u74b0\u5883] &#8211; [\u8a2d\u5b9a] &#8211; [\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2] \u304b\u3089\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u304c\u8868\u984c\u306e\u4ef6\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/karukichi-blog.netlify.app\/blogs\/resolve-403-error-in-s3\">S3\u306e403 Access Denied\u3092\u89e3\u6c7a\u3059\u308b\u6642\u306e\u899a\u66f8<\/a><\/p>\n\n\n\n<p>\u30d1\u30d6\u30ea\u30c3\u30af\u30a2\u30af\u30bb\u30b9\u3092[\u516c\u958b]\u306b\u3057\u3066[\u30dd\u30ea\u30b7\u30fc\u306e\u7de8\u96c6]\u304b\u3089 \u5fc5\u8981\u306aIAM\u30e6\u30fc\u30b6\u30fc\u306eARN(Amazon Resource Name)\u3068S3\u30d0\u30b1\u30c3\u30c8ARN, EC2Role\u306eARN\u3092\u8a31\u53ef\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre>{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"PolicyForAllowUploadWithACL\",\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"AWS\": \"arn:aws:iam::111122223333:user\/myusername\"\n            },\n            \"Action\": \"s3:PutObject\",\n            \"Resource\": \"arn:aws:s3:::s3-sample-bucket-name\/*\",\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"s3:x-amz-acl\": \"bucket-owner-full-control\"\n                }\n            }\n        },\n        {\n            \"Sid\": \"PolicyForAllowUploadWithEC2-role\",\n            \"Effect\": \"Allow\",\n            \"Principal\": {\n                \"AWS\": \"arn:aws:iam::111122223333:role\/aws-elasticbeanstalk-ec2-role\"\n            },\n            \"Action\": \"s3:PutObject\",\n            \"Resource\": \"arn:aws:s3:::s3-sample-bucket-name\/*\",\n            \"Condition\": {\n                \"StringEquals\": {\n                    \"s3:x-amz-acl\": \"bucket-owner-full-control\"\n                }\n            }\n        }\n    ]\n}<\/pre>\n\n\n<p>IAM\u304b\u3089[aws-elasticbeanstalk-ec2-role] \u306b\u4e0b\u8a18\u30dd\u30ea\u30b7\u30fc\u3092\u8ffd\u52a0\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"596\" src=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy-1024x596.png\" alt=\"\" class=\"wp-image-10935\" srcset=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy-1024x596.png 1024w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy-300x175.png 300w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy-768x447.png 768w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/01\/ec2-role_policy.png 1068w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p>\u3053\u308c\u3067\u7121\u4e8b\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u753b\u50cf\u304cS3\u30d0\u30b1\u30c3\u30c8\u306b\u4fdd\u5b58\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u53c2\u8003URL: <a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/userguide\/example-bucket-policies.html\">Bucket policy examples &#8211; Amazon Simple Storage Service<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWSElasticBeanstalk\u74b0\u5883\u3067Node.js\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3001S3\u30d0\u30b1\u30c3\u30c8\u3078\u306e\u63a5\u7d9a\u3092\u3057\u305f\u3068\u3053\u308d\u3001Error Access Denied \u3068\u306a\u308a\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002\u63a5\u7d9a\u3059\u308b\u306b\u306f\u30a2\u30af\u30bb\u30b9\u30ad\u30fc\u306e\u307b\u304b\u306b\u30d0\u30b1\u30c3\u30c8\u30dd\u30ea [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,90],"tags":[],"class_list":["post-10933","post","type-post","status-publish","format-standard","hentry","category-aws-2","category-s3"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/10933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/comments?post=10933"}],"version-history":[{"count":10,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/10933\/revisions"}],"predecessor-version":[{"id":10945,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/10933\/revisions\/10945"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/media?parent=10933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/categories?post=10933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/tags?post=10933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}