{"id":18301,"date":"2022-10-23T22:31:37","date_gmt":"2022-10-23T13:31:37","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=18301"},"modified":"2023-05-27T17:39:16","modified_gmt":"2023-05-27T08:39:16","slug":"%e3%80%90aws%e3%80%91iam%e3%81%ae%e3%80%8cassumerole%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=18301","title":{"rendered":"\u3010AWS\u3011IAM\u306e\u300cAssumeRole\uff08\u30a2\u30b7\u30e5\u30fc\u30e0\u30ed\u30fc\u30eb\uff09\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>AssumeRole\uff08\u30a2\u30b7\u30e5\u30fc\u30e0\u30ed\u30fc\u30eb\uff09\u3068\u306f\uff1f<\/h2>\n<p>\u30ed\u30fc\u30eb\u3092\u5f15\u304d\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308bIAM\u306e\u6a5f\u80fd\u306e\u3053\u3068\u3067\u3059\u3002\u30a4\u30e1\u30fc\u30b8\u7684\u306b\u306f\u4f01\u696d\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ab\u30fc\u30c9\u898b\u305f\u3044\u306a\u611f\u3058\u3067\u3059\u3002\u81ea\u5206\u304c\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u3067\u3042\u3063\u3066\u3082\u5951\u7d04\u3092\u3057\u3066\u4f01\u696d\u3067\u50cd\u3044\u3066\u3082\u826f\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u305f\u3089\u30ab\u30fc\u30c9\u3092\u53d7\u3051\u53d6\u3063\u3066\u81ea\u7531\u306b\u5165\u9000\u5ba4\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u8907\u6570\u306eAssumeRole\u3092\u639b\u3051\u6301\u3061\u3001\u91cd\u306d\u639b\u3051\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u4ed5\u7d44\u307f<\/h2>\n<h3>AssumeRole\u3092\u5b9f\u884c\u3059\u308b\u969b\u306fSTS\u3092\u4ecb\u3057\u3066\u3044\u308b\u3002<\/h3>\n<p>STS\u3068\u306f\u3001\u7279\u5b9a\u306eAWS\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u4e00\u6642\u7684\u306a\u8a8d\u8a3c\u60c5\u5831\u3092\u767a\u884c\u3059\u308b\u4e8b\u304c\u3067\u304d\u308bAWS\u306e\u30b5\u30fc\u30d3\u30b9\u3067\u3059\u3002<\/p>\n<h2>\u30b9\u30a4\u30c3\u30c1\u30ed\u30fc\u30eb\u3068\u306e\u9055\u3044<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306fAssumeRole\u3068\u30b9\u30a4\u30c3\u30c1\u30ed\u30fc\u30eb\u306f\u6587\u8108\u7684\u306b\u306f\u307b\u307c\u540c\u3058\u3053\u3068\u3092\u6307\u3057\u3066\u3044\u307e\u3059\u3002\u53b3\u5bc6\u306b\u3044\u3048\u3070AssumeRole\u306fAWS\u306e\u7528\u610f\u3059\u308bAPI\u306e\u540d\u524d\u3067\u3042\u308a\u3001\u30b9\u30a4\u30c3\u30c1\u30ed\u30fc\u30eb\u306f\u300cRole\u3092\u5f15\u304d\u53d7\u3051\u3066\u6a29\u9650\u3092\u30b9\u30a4\u30c3\u30c1\u3059\u308b\u4f5c\u696d\u300d\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30a4\u30c3\u30c1\u30ed\u30fc\u30eb\u3068\u3044\u3046\u76ee\u7684\u306e\u305f\u3081\u306bAssumeRole API\u3092\u767a\u884c\u3059\u308b\u3068\u3044\u3046\u3088\u3046\u306a\u610f\u5473\u5408\u3044\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u5177\u4f53\u4f8b<\/h2>\n<p>EC2\u306b\u5bfe\u3057\u3066S3\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308bAssumeRole\u3092\u4ed8\u4e0e\u3059\u308b\u3002<\/p>\n<h2>\u8a2d\u5b9a<\/h2>\n<pre class=\"lang:default decode:true\">{\r\n    \"Version\": \"2012-10-17\",\r\n    \"Statement\": [\r\n        {\r\n            \"Effect\": \"Allow\",\r\n            \"Principal\": {\r\n                \"Service\": \"ec2.amazonaws.com\"\r\n            },\r\n            \"Action\": \"sts:AssumeRole\"\r\n        }\r\n    ]\r\n}<\/pre>\n<p>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30ed\u30fc\u30eb\u306e\u4e2d\u306e\u300c\u4fe1\u983c\u95a2\u4fc2\u300d\u3068\u3044\u3046\u8a2d\u5b9a\u306e\u4e2d\u306b\u300c\"Action\": \"sts:AssumeRole\"\u300d\u3068\u3044\u3046\u8a2d\u5b9a\u9805\u76ee\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3067EC2\u306f\u4f55\u304b\u3057\u3089\u306e\u6a29\u9650\u3092\u884c\u4f7f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u8a2d\u5b9a\u5bfe\u8c61<\/h2>\n<ul>\n<li>EC2<\/li>\n<li>IAM\u30e6\u30fc\u30b6\u30fc<\/li>\n<\/ul>\n<p>EC2\u3060\u3051\u3067\u306a\u304f\u666e\u901a\u306bIAM\u30e6\u30fc\u30b6\u30fc\u306b\u3082\u540c\u3058\u3088\u3046\u306bAssumeRole\u306f\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u3044\u3061\u3044\u3061\u3001EC2\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3073\u306bIAM\u30e6\u30fc\u30b6\u30fc\u3092\u6bce\u56de\u767a\u884c\u3059\u308b\u306e\u306f\u3081\u3093\u3069\u304f\u3055\u3044\u3002\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3073\u306bAssumeRole\u3067\u4e00\u6642\u30c8\u30fc\u30af\u30f3\u3092\u767a\u884c\u3057\u3066\u3084\u3063\u305f\u65b9\u304c\u4f5c\u696d\u304c\u65e9\u3044\u3002<\/p>\n<p>\u958b\u767a\u8005\u304b\u3089\u3057\u305f\u3089\u30ed\u30b0\u30a4\u30f3\u3092\u6bce\u56de\u3057\u76f4\u3059\u5fc5\u8981\u304c\u306a\u3044\u306e\u3067\u697d\u3002(\u3053\u306e\u5834\u5408\u3001SwitchRole\u3068\u3044\u3046\u6a5f\u80fd\u3092\u4f7f\u3046\u3002\u88cf\u5074\u3067\u306fAssumeRole\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u3002\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"AssumeRole\uff08\u30a2\u30b7\u30e5\u30fc\u30e0\u30ed\u30fc\u30eb\uff09\u3068\u306f\uff1f \u30ed\u30fc\u30eb\u3092\u5f15\u304d\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308bIAM\u306e\u6a5f\u80fd\u306e\u3053\u3068\u3067\u3059\u3002\u30a4\u30e1\u30fc\u30b8\u7684\u306b\u306f\u4f01\u696d\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ab\u30fc\u30c9\u898b\u305f\u3044\u306a\u611f\u3058\u3067\u3059\u3002\u81ea\u5206\u304c\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u3067\u3042\u3063\u3066\u3082\u5951\u7d04\u3092\u3057\u3066\u4f01\u696d\u3067\u50cd\u3044\u3066\u3082\u826f\u3044\u3068\u3044\u3046 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[80],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18301"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18301"}],"version-history":[{"count":8,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18301\/revisions"}],"predecessor-version":[{"id":20054,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18301\/revisions\/20054"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18301"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}