{"id":14739,"date":"2017-12-02T09:00:15","date_gmt":"2017-12-02T00:00:15","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=14739"},"modified":"2018-11-14T16:33:42","modified_gmt":"2018-11-14T07:33:42","slug":"aws-cli-presign","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2017\/12\/02\/aws-cli-presign\/","title":{"rendered":"AWS S3 CLI \u4e8b\u524d\u7f72\u540d\u4ed8\u304dURL\u767a\u884c\u30b3\u30de\u30f3\u30c9 presign \u304c\u4fbf\u5229\u904e\u304e\u3066\u611f\u6fc0\u3057\u306a\u304c\u3089\u8003\u3048\u305f\u3053\u3068"},"content":{"rendered":"
\u3053\u3093\u306b\u3061\u306f\u3002\u68b6\u539f\u3067\u3059\u3002 Amazon Web Service \u3092\u5229\u7528\u3057\u3066\u3044\u3066\u3001\u4e45\u3057\u3076\u308a\u306b \u300d\u3068\u53eb\u3073\u305f\u304f\u306a\u3063\u305f\u51fa\u6765\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002 CLI \u30b3\u30de\u30f3\u30c9\u300cpresign\u300d\u306b\u95a2\u3059\u308b\u8a18\u8ff0\u306f\u8a18\u4e8b\u306e\u4e2d\u307b\u3069\u3067\u3059\u3002\u3053\u3061\u3089\u304b\u3089\u30b8\u30e3\u30f3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/a><\/p>\n \u793e\u5185\u3067\u3061\u3087\u3063\u3068\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u53d7\u3051\u6e21\u3057\u3092\u3059\u308b\u3068\u304d\u306b\u3001\u56f0\u3063\u305f\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n \u3053\u3046\u3044\u3046\u6642\u306b\u5a01\u529b\u3092\u767a\u63ee\u3059\u308b\u306e\u304c\u300c\u4e8b\u524d\u7f72\u540d\u4ed8\u304d URL\uff08pre-signed URL\uff09\u300d\u3067\u3059\u3002 AWS \u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306f\u4e0d\u8981\u3002URL\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3060\u3051\u3067\u30d5\u30a1\u30a4\u30eb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u53ef\u80fd\u3067\u3059\u3002\u958b\u767a\u696d\u52d9\u3067\u306f\u306a\u3044\u90e8\u7f72\u306e\u30e1\u30f3\u30d0\u30fc\u3067\u3082\u64cd\u4f5c\u306b\u8ff7\u3044\u304c\u8d77\u304d\u306a\u3044\u3001\u89aa\u5207\u306a\u65b9\u6cd5\u3067\u3059\u3002 \u306a\u304a\u3001S3 \u30a2\u30af\u30bb\u30b9\u6642\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306b\u3064\u3044\u3066\u306f AWS \u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u7ba1\u7406\u8005\u3068\u4e8b\u524d\u306b\u3088\u304f\u76f8\u8ac7\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n S3 \u306e\u4e8b\u524d\u7f72\u540d\u4ed8\u304d URL \u306e\u767a\u884c\u65b9\u6cd5\u306f\u3001\u6570\u5e74\u524d\u306b\u8abf\u3079\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u7f72\u540d\u4ed8\u304d URL \u306e\u7f72\u540d\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u4f8b - Amazon CloudFront<\/a><\/p>\n \u793e\u5185\u696d\u52d9\u3067 S3 \u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u3084\u308a\u53d6\u308a\u304c\u5fc5\u8981\u306b\u306a\u308a\u3001\u300c\u3068\u3046\u3068\u3046\u3042\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u6d3b\u304b\u3055\u305b\u3066\u3082\u3089\u3046\u6a5f\u4f1a\u304c\u6765\u305f\u304b\u30fc\u300d\u3068\u899a\u609f\u3092\u6c7a\u3081\u307e\u3057\u305f\u3002 \u3068\u3002<\/p>\n \u306f\u3044\u3002\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u7c21\u5358\u306b\u51fa\u6765\u308b\u3093\u3067\u3059<\/strong>\u3002\u305d\u308c\u304c\u300cpresign\u300d\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002 presign \u2014 AWS CLI 1.12.0 Command Reference<\/a><\/p>\n \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306e\u77ed\u3055\u304b\u3089\u3082\u5206\u304b\u308b\u901a\u308a\u3001\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002 \u751f\u6210\u3055\u308c\u305fURL \u306e\u4f8b\uff08\u4e00\u90e8 \u52a0\u5de5\u6e08\u307f\uff09 \u6709\u52b9\u671f\u9650\u5185\u306bURL\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u304c\u3001\u6709\u52b9\u671f\u9650\u304c\u5207\u308c\u308b\u3068\u30a8\u30e9\u30fc\u60c5\u5831\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\uff08\u4e00\u90e8 \u52a0\u5de5\u6e08\u307f\uff09 \u8a2d\u5b9a\u3067\u304d\u308b\u6709\u52b9\u671f\u9650\u306b\u4e0a\u9650\u5024\u3092\u8a2d\u3051\u3089\u308c\u3066\u3044\u308b\u3093\u3060\u308d\u3046\u304b\uff1f\u3000\u3068\u7591\u554f\u3092\u611f\u3058\u308b\u4eba\u304c\u3044\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002 \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e2d\u306b\u6709\u52b9\u671f\u9650\u3092\u8fce\u3048\u305f\u5834\u5408\u306f\u3069\u3046\u306a\u308b\u3093\u3060\uff1f\u3000\u3068\u7591\u554f\u3092\u611f\u3058\u308b\u4eba\u3082\u3044\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002 \u4e8b\u524d\u7f72\u540d\u4ed8\u304d URL \u306e SDK \u89e3\u8aac\u7b87\u6240\u306b\u300cpresign \u30b3\u30de\u30f3\u30c9\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u305f\u304b\u3089\u3053\u3063\u3061\u3082\u78ba\u8a8d\u3057\u3066\u306d\u300d\u7b49\u306e\u30ea\u30f3\u30af\u304c\u7121\u3044\u306a\u3069\u3001\u60c5\u5831\u306e\u6574\u7406\u306b\u95a2\u3057\u3066\u306f\u591a\u5c11\u3068\u3063\u6563\u3089\u304b\u3063\u3066\u3044\u308b\u5370\u8c61\u306f\u3042\u308a\u307e\u3059\uff08\u203b\u500b\u4eba\u306e\u611f\u60f3\u3067\u3059\uff01\uff09\u304c\u3001\u3088\u304f\u3042\u308b\u7591\u554f\u306f\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3060\u3051\u3067\u89e3\u6c7a\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n S3 \u4e0a\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u6e21\u3057\u305f\u3044\u3001\u3051\u3069\u2026\u3001\u3068\u3044\u3046\u79c1\u306e\u56f0\u308a\u3054\u3068\u3092\u5b8c\u74a7\u304b\u3064\u7dba\u9e97\u306b\u30cf\u30de\u308b\u5f62\u3067\u89e3\u6c7a\u3057\u3066\u304f\u308c\u305f\u300cpresign\u300d\u30b3\u30de\u30f3\u30c9\u3002 \u5404\u7a2e\u8a00\u8a9e\u3067 URL \u3092\u767a\u884c\u3067\u304d\u308b SDK \u3092\u65e2\u306b\u63d0\u4f9b\u6e08\u307f\u3067\u3042\u308b\u306e\u306b\u3001\u66f4\u306b\u4e00\u6b69\u8e0f\u307f\u8fbc\u3093\u3067\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u7c21\u5358\u306b\u767a\u884c\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u3001\u305d\u3057\u3066\u5b9f\u73fe\u3057\u305f AWS \u958b\u767a\u9663\u306e\u7686\u3055\u3093\u306f\u3059\u3054\u3044\uff01\u3000\u3088\u304f\u305e\u6c17\u304c\u4ed8\u3044\u3066\u304f\u308c\u305f\u3001\u3068\u611f\u8b1d\u611f\u6fc0\u3067\u3057\u305f\u3002<\/p>\n \u300c\u9a5a\u304d\u3068\u559c\u3073\uff08\u5e78\u305b\uff09\u3092\u63d0\u4f9b\u3059\u308b\u300d\u3068\u3044\u3046\u76ee\u6a19\u3092\u63b2\u3052\u3066\u3044\u308b\u4f1a\u793e\u306f\u6570\u591a\u3042\u308a\u307e\u3059\u3002 \u3053\u3093\u306b\u3061\u306f\u3002\u68b6\u539f\u3067\u3059\u3002 Amazon Web Service \u3092\u5229\u7528\u3057\u3066\u3044\u3066\u3001\u4e45\u3057\u3076\u308a\u306b
\n\u3053\u308c\u306f TECHSCORE Advent Calendar 2017<\/a> \u306e2\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n
\n\u3042\u3089\u3093\u9650\u308a\u306e\u58f0\u3067\u300c<\/p>\n(\u4eba''\u25bd\uff40)\u3042\u308a\u304c\u3068\u3046\u2606<\/h3>\n
\n\u30af\u30ea\u30b9\u30de\u30b9\u306f\u611f\u8b1d\u306e\u5b63\u7bc0\uff01\u3000\u3042\u307e\u308a\u306b\u3082\u5b09\u3057\u304b\u3063\u305f\u306e\u3067\u3001\u8a18\u4e8b\u306b\u6b8b\u3057\u3066\u304a\u304f\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\u76ee\u6b21<\/h2>\n
\n
\u56f0\u3063\u305f\u3001S3 \u4e0a\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u6e21\u3057\u305f\u3044\u3001\u3051\u3069\u2026<\/h2>\n
\nphoto credit: professor.jruiz FlickrCC<\/a> via photopin<\/a> (license)<\/a><\/p>\n\n
\n\u4ed6\u90e8\u7f72\u306e\u30e1\u30f3\u30d0\u30fc\u306b AWS \u306e\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u6e21\u3057\u305f\u304f\u306a\u3044<\/li>\n
\n\u6559\u3048\u305f URL \u304c\u300cNot Found\u300d\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u306f\u30ab\u30c3\u30b3\u60aa\u3044<\/li>\n
\n\u6709\u52b9\u671f\u9650\u4ed8\u304d\u3067 URL \u3092\u767a\u884c\u3067\u304d\u308c\u3070\u30d1\u30fc\u30d5\u30a7\u30af\u30c8\u3067\u3059\u306d\u3002<\/p>\n
\n\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u524d\u306b\u5fc5\u305a URL \u306e\u6709\u52b9\u671f\u9650\u304c\u5207\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3051\u3070\u3001\u6709\u52b9\u671f\u9650\u304c\u5207\u308c\u305f\u5f8c\u306f\u300c\u30a2\u30af\u30bb\u30b9\u62d2\u5426\u300d\u3068\u306a\u308a\u307e\u3059\u3002URL \u3092\u767a\u884c\u3059\u308b\u5074\u304c\u671f\u9650\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3059\u308b\u306e\u3067\u3001\u300cNot Found\u300d\u306e100\u500d\u306f\u30ab\u30c3\u30b3\u826f\u3044\uff01\u30fe(*\u2267\u2200\u2266)\uff89\uff9e<\/p>\n\u4ee5\u524d\u306f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u5fc5\u8981\u3060\u3063\u305f\u3051\u3069\u3001\u4eca\u306f\u2026<\/h2>\n
\nJava \u3084 Perl \u3067\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u304a\u308a\u3001\u300c\u3075\u30fc\u3093\u3001\u610f\u5916\u306b\u9762\u5012\u3060\u306a\u30fc\u300d\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n
\n\u305d\u3057\u3066\u3001\u3075\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\nCLI \u30b3\u30de\u30f3\u30c9\u64cd\u4f5c\u3067 URL \u304c\u767a\u884c\u51fa\u6765\u308c\u3070\u3044\u3044\u306e\u306b\u306a\u30fc(\u00b4\u30fb\u03c9\u30fb`)\u3001<\/h3>\n
\n\u4eca\u304b\u30891\u5e74\u4ee5\u4e0a\u524d\u306b\u30ea\u30ea\u30fc\u30b9\u6e08\u307f\u3002
\n\u77e5\u3089\u306a\u3044\u3068\u306f\u6050\u308d\u3057\u3044\u3082\u306e\u3067\u3001\u5371\u3046\u304f\u81ea\u5206\u3067\u30ac\u30ea\u30ac\u30ea\u3068\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u697d\u3057\u3080\u2026\u6642\u9593\u3092\u7121\u99c4\u306b\u3059\u308b\u3068\u3053\u308d\u3067\u3057\u305f\u3002<\/p>\n\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30de\u30f3\u30c9\u300cpresign\u300d<\/h2>\n
\n\u5229\u7528\u65b9\u6cd5\u3082\u660e\u5feb\u3067\u3001S3 \u306e\u30ea\u30bd\u30fc\u30b9URL \u3068\u3001\u5fc5\u8981\u306a\u5834\u5408\u306f --expires-in \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6709\u52b9\u671f\u9650\uff08\u5358\u4f4d\uff1a\u79d2\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f3,600\u79d2 = 1\u6642\u9593\uff09\u3092\u8a2d\u5b9a\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n\r\n# S3 \u306e\u30ea\u30bd\u30fc\u30b9URL\u3092 ****\/my-bucket\/test\/my-data.csv \u3001\r\n# \u6709\u52b9\u671f\u9650\u3092300\u79d2\uff085\u5206\uff09\u3068\u3059\u308b\u5834\u5408\r\naws s3 presign ****\/my-bucket\/test\/my-data.csv --expires-in 300\r\n\r\n# (\u8a00\u3046\u307e\u3067\u3082\u7121\u3044\u3053\u3068\u3067\u3059\u304c\u3001\u3053\u306e\u4f8b\u306f\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u307e\u305b\u3093!) \r\n<\/pre>\n
\nhttps:\/\/****\/my-bucket.s3.amazonaws.com\/test\/my-data.csv?AWSAccessKeyId=AABBCCDDEEFFGGHHIIJJKK&Expires=1511780718&Signature=xs3S3AbCdefG7hjJKfooFobar7c%3D<\/code><\/p>\n
\n<\/p>\n
\u60c5\u5831\u63b2\u8f09\u304c\u884c\u304d\u5c4a\u3044\u305f\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u305f\u3061<\/h2>\n
\nAWS SDK \u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3061\u3083\u3093\u3068\u7b54\u3048\u304c\u3042\u308a\u307e\u3057\u305f\u3002\uff08 Ruby \u7248\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u306e\u5834\u5408\uff09
\nClass: Aws::S3::Presigner \u2014 AWS SDK for Ruby V2<\/a>
\n\u300c7\u65e5\u9593\uff08604,800\u79d2\uff09\u300d\u3067\u3059\u3002<\/p>\n
\n\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3061\u3083\u3093\u3068\u7b54\u3048\u304c\u3042\u308a\u307e\u3057\u305f\u3002
\n\u7f72\u540d\u4ed8\u304d URL \u306e\u4f7f\u7528 - Amazon CloudFront<\/a>
\n\u300c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e2d\u306b\u6709\u52b9\u671f\u9650\u5207\u308c\u6642\u523b\u304c\u7d4c\u904e\u3057\u3066\u3082\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u5b8c\u4e86\u3057\u307e\u3059\u300d\u3067\u3059\u3002<\/p>\n\u611f\u6fc0\u3057\u306a\u304c\u3089\u8003\u3048\u305f\u3053\u3068\u3068\u3001\u307e\u3068\u3081<\/h2>\n
\n\u30b7\u30f3\u30d7\u30eb\u304b\u3064\u8ff7\u3044\u304c\u306a\u3044\u4ed5\u69d8\u3002
\n\u7591\u554f\u306b\u660e\u5feb\u306b\u7b54\u3048\u3066\u304f\u308c\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3002<\/p>\n
\n\u5f53\u7136\u6211\u304c\u793e\u3082\u305d\u306e1\u3064\u306a\u306e\u3067\u3059\u304c\u3001\u300c\u305d\u3046\u304b\u3001\u3053\u3046\u3044\u3046\u4e8b\u304b\u300d\u3068\u4eca\u56de\u306e\u4f53\u9a13\u3092\u901a\u3058\u3066\u6539\u3081\u3066\u8a8d\u8b58\u3057\u307e\u3057\u305f\u3002
\n\u3053\u306e\u300c\u30b9\u30c8\u30f3\u3068\u8151\u306b\u843d\u3061\u305f\u611f\u300d\u3092\u4ed6\u306e\u8ab0\u304b\u306b\u624b\u6e21\u305b\u308b\u6210\u679c\u3092\u79c1\u3082\u6319\u3052\u3066\u3044\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3057\u3001\u305d\u3046\u3067\u304d\u308c\u3070\u3044\u3044\u3001\u3092\u76ee\u6a19\u306b\u65e5\u3005\u7814\u947d\u3092\u7a4d\u3093\u3067\u884c\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\nphoto credit: K-nekoTR SAKURA #517<\/a> via photopin<\/a> (license)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"
\n\u3053\u308c\u306f TECHSCORE Advent Calendar 2017 \u306e2\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n
\n\u3042\u3089\u3093\u9650\u308a\u306e\u58f0\u3067\u300c
\n(\u4eba''\u25bd\uff40)\u3042\u308a\u304c\u3068\u3046\u2606
\n\u300d\u3068\u53eb\u3073\u305f\u304f\u306a\u3063\u305f\u51fa\u6765\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002
\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[276,18],"tags":[141,119],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/14739"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=14739"}],"version-history":[{"count":75,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/14739\/revisions"}],"predecessor-version":[{"id":14824,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/14739\/revisions\/14824"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=14739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=14739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=14739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}