{"id":3227,"date":"2020-03-29T08:29:29","date_gmt":"2020-03-28T23:29:29","guid":{"rendered":"http:\/\/blog.rutake.com\/techmemo\/?p=3227"},"modified":"2020-03-29T08:30:56","modified_gmt":"2020-03-28T23:30:56","slug":"terraform-aws-profile%e3%81%ae%e6%8c%87%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/blog.rutake.com\/techmemo\/2020\/03\/29\/terraform-aws-profile%e3%81%ae%e6%8c%87%e5%ae%9a\/","title":{"rendered":"Terraform AWS profile\u306e\u6307\u5b9a"},"content":{"rendered":"\n<p>Terraform\u306e\u5b9f\u884c\u306b\u306f\u305d\u308c\u306a\u308a\u306b\u5f37\u529b\u306a\u6a29\u9650\u3092\u4f34\u3046\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306bIAM key\/secret\u3092\u66f8\u304f\u306e\u306f\u5371\u967a\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306faws cli\u3092\u5229\u7528\u3057\u305fprofile\u3092\u4f7f\u3046\u3068\u826f\u3044\u3002\u3093\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306eprofile\u3060\u3068\u305d\u308c\u3082\u8aa4\u64cd\u4f5c\u306e\u53ef\u80fd\u6027\u304c\u5897\u3048\u308b\u306e\u3067profile\u3092\u6307\u5b9a\u3059\u308b\u3002<\/p>\n\n\n\n<p>It is dangerous to write the IAM key\/secret in the code because Terraform execution involves powerful privileges.<\/p>\n\n\n\n<p>To avoid that, it&#8217;s a good idea to use a PROFILE that uses the AWS CLI. And if it&#8217;s the default profile, the possibility of misoperation increases too, so I specify a profile.  as follows<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#main.tf\nprovider \"aws\" {\n   version  = \"~>2.0\"\n   # IAM profile\n   profile = \"s3\"\n }<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Terraform\u306e\u5b9f\u884c\u306b\u306f\u305d\u308c\u306a\u308a\u306b\u5f37\u529b\u306a\u6a29\u9650\u3092\u4f34\u3046\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306bIAM ke &hellip; <a href=\"https:\/\/blog.rutake.com\/techmemo\/2020\/03\/29\/terraform-aws-profile%e3%81%ae%e6%8c%87%e5%ae%9a\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/3227"}],"collection":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/comments?post=3227"}],"version-history":[{"count":2,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/3227\/revisions"}],"predecessor-version":[{"id":3229,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/posts\/3227\/revisions\/3229"}],"wp:attachment":[{"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/media?parent=3227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/categories?post=3227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rutake.com\/techmemo\/wp-json\/wp\/v2\/tags?post=3227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}