{"id":1910,"date":"2024-07-19T16:06:20","date_gmt":"2024-07-19T09:06:20","guid":{"rendered":"https:\/\/pirago.vn\/?post_type=article&#038;p=1910"},"modified":"2024-07-19T16:15:45","modified_gmt":"2024-07-19T09:15:45","slug":"terraform-iac","status":"publish","type":"article","link":"https:\/\/pirago.vn\/ja\/article\/terraform-iac","title":{"rendered":"Terraform: \u52b9\u679c\u7684\u306a\u30af\u30e9\u30a6\u30c9\u30a4\u30f3\u30d5\u30e9\u306e\u81ea\u52d5\u5316\u306e\u9375"},"content":{"rendered":"\n<p>\u73fe\u5728\u306e\u53b3\u3057\u3044IT\u5e02\u5834\u306b\u304a\u3044\u3066\u3001\u30d9\u30a2\u30e1\u30bf\u30eb\u3084\u30af\u30e9\u30a6\u30c9\u4e0a\u306e\u30b7\u30b9\u30c6\u30e0\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u3068\u904b\u7528\u306b\u304b\u304b\u308b\u6642\u9593\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3059\u308b\u3053\u3068\u304c\u307e\u3059\u307e\u3059\u91cd\u8981\u8996\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f01\u696d\u306f\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u306e\u6642\u9593\u3092\u77ed\u7e2e\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8fc5\u901f\u306b\u5e02\u5834\u306b\u6295\u5165\u3057\u3001\u3088\u308a\u591a\u304f\u306e\u9867\u5ba2\u306b\u30ea\u30fc\u30c1\u3057\u3001\u58f2\u4e0a\u3092\u5897\u52a0\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u7406\u89e3\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u591a\u304f\u306e\u4f01\u696d\u306f\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u306e\u81ea\u52d5\u5316\u306b\u91cd\u70b9\u3092\u7f6e\u3044\u3066\u304a\u3089\u305a\u3001\u904b\u7528\u4e2d\u306b\u591a\u304f\u306e\u554f\u984c\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u624b\u52d5\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u306e\u554f\u984c\u70b9<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u624b\u52d5\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u3001\u591a\u304f\u306e\u30b9\u30bf\u30c3\u30d5\u3068\u90e8\u9580\u304c\u95a2\u4e0e\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5b8c\u4e86\u304c\u9045\u308c\u3001\u4eba\u4ef6\u8cbb\u304c\u5897\u52a0\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u624b\u52d5\u64cd\u4f5c\u306f\u4eba\u70ba\u7684\u306a\u30df\u30b9\u3092\u5f15\u304d\u8d77\u3053\u3057\u3084\u3059\u304f\u3001\u8a2d\u5b9a\u306e\u9593\u9055\u3044\u3084\u91cd\u8981\u306a\u30b9\u30c6\u30c3\u30d7\u306e\u898b\u843d\u3068\u3057\u304c\u30b5\u30fc\u30d3\u30b9\u969c\u5bb3\u3084\u30c0\u30a6\u30f3\u30bf\u30a4\u30e0\u3092\u5f15\u304d\u8d77\u3053\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u4f4e\u4e0b\u3055\u305b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u624b\u52d5\u8a2d\u5b9a\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4ed6\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u518d\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u96e3\u3057\u304f\u3001\u4f5c\u696d\u306e\u7e70\u308a\u8fd4\u3057\u304c\u767a\u751f\u3057\u30b3\u30b9\u30c8\u304c\u5897\u52a0\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u624b\u52d5\u5c55\u958b\u306f\u74b0\u5883\u9593\u306e\u4e00\u8cab\u6027\u3092\u6b20\u304d\u3001\u4e92\u63db\u6027\u306e\u554f\u984c\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u3092\u5f15\u304d\u8d77\u3053\u3057\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u8106\u5f31\u6027\u3092\u3082\u305f\u3089\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u8907\u96d1\u306a\u30a4\u30f3\u30d5\u30e9\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001\u4ed6\u306e\u30c1\u30fc\u30e0\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u5c55\u958b\u3092\u5f15\u304d\u7d99\u3050\u969b\u306b\u3001\u8a73\u7d30\u306a\u30ac\u30a4\u30c9\u304c\u5fc5\u8981\u3067\u3042\u308a\u3001\u30df\u30b9\u3084\u9593\u9055\u3063\u305f\u5c55\u958b\u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u3092\u5f15\u304d\u8d77\u3053\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30d5\u30e9\u81ea\u52d5\u5316\u306e\u5fc5\u8981\u6027<\/h2>\n\n\n\n<p>\u30a4\u30f3\u30d5\u30e9\u81ea\u52d5\u5316\u306f\u73fe\u4ee3\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u91cd\u8981\u3067\u3042\u308a\u3001\u624b\u52d5\u30d7\u30ed\u30bb\u30b9\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u3067\u52b9\u7387\u3092\u9ad8\u3081\u3001\u30a8\u30e9\u30fc\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u3001\u30b3\u30b9\u30c8\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3068\u67d4\u8edf\u6027\u306b\u3088\u308a\u3001\u4f01\u696d\u306f\u30d3\u30b8\u30cd\u30b9\u3068\u9867\u5ba2\u306e\u30cb\u30fc\u30ba\u306b\u5fdc\u3058\u3066\u30a4\u30f3\u30d5\u30e9\u3092\u8abf\u6574\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u81ea\u52d5\u5316\u306f\u4e00\u8cab\u6027\u3001\u898f\u5236\u9075\u5b88\u3001\u56de\u5fa9\u529b\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u78ba\u4fdd\u3057\u3001\u7d99\u7d9a\u7684\u304b\u3064\u8fc5\u901f\u306a\u5c55\u958b\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4f01\u696d\u306f\u904b\u7528\u3092\u6700\u9069\u5316\u3057\u3001\u7af6\u4e89\u529b\u3092\u7dad\u6301\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u81ea\u52d5\u5316\u306b\u304a\u3051\u308bIaC<\/h2>\n\n\n\n<p>\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u81ea\u52d5\u5316\u306b\u304a\u3044\u3066\u3001IaC\uff08Infrastructure as Code\uff09\u30c4\u30fc\u30eb\u3068\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306f\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002IaC\u306f\u3001\u624b\u52d5\u3067\u306f\u306a\u304f\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3001\u304a\u3088\u3073\u95a2\u9023\u30b5\u30fc\u30d3\u30b9\u3092\u7ba1\u7406\u304a\u3088\u3073\u5c55\u958b\u3059\u308b\u624b\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<p>IaC\u306e\u4e3b\u306a\u5229\u70b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4e00\u8cab\u6027\u3068\u518d\u5229\u7528\u6027\uff1a\u3059\u3079\u3066\u306e\u30a4\u30f3\u30d5\u30e9\u8a2d\u5b9a\u304c\u30b3\u30fc\u30c9\u3067\u7ba1\u7406\u3055\u308c\u308b\u305f\u3081\u3001\u4e00\u8cab\u6027\u3092\u78ba\u4fdd\u3057\u3001\u7c21\u5358\u306b\u518d\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u81ea\u52d5\u5316\u3068\u30a8\u30e9\u30fc\u306e\u524a\u6e1b\uff1a\u5c55\u958b\u304a\u3088\u3073\u66f4\u65b0\u30d7\u30ed\u30bb\u30b9\u304c\u81ea\u52d5\u5316\u3055\u308c\u3001\u4eba\u70ba\u7684\u306a\u30a8\u30e9\u30fc\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u6642\u9593\u3068\u30ea\u30bd\u30fc\u30b9\u306e\u7bc0\u7d04\uff1aIT\u30b9\u30bf\u30c3\u30d5\u304c\u624b\u52d5\u3067\u69cb\u6210\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3053\u308c\u3089\u306e\u30bf\u30b9\u30af\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u3067\u6642\u9593\u3068\u30ea\u30bd\u30fc\u30b9\u3092\u7bc0\u7d04\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\uff1a\u30a4\u30f3\u30d5\u30e9\u306f\u30b3\u30fc\u30c9\u5316\u3092\u5f37\u5316\u3057\u3001IaC\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u7c21\u5358\u306b\u62e1\u5f35\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>Ansible\u3001Terraform\u3001Chef\u3001Puppet\u306a\u3069\u306eIaC\u30c4\u30fc\u30eb\u3084\u3001\u30b3\u30f3\u30c6\u30ca\u7ba1\u7406\u306e\u305f\u3081\u306eKubernetes\u306a\u3069\u304c\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f01\u696d\u304cIaC\u3092\u5c0e\u5165\u3059\u308b\u306b\u306f\u660e\u78ba\u306a\u6226\u7565\u304c\u5fc5\u8981\u3067\u3001\u3059\u3079\u3066\u306e\u30ea\u30bd\u30fc\u30b9\u3068\u30d7\u30ed\u30bb\u30b9\u304c\u81ea\u52d5\u5316\u30d7\u30ed\u30bb\u30b9\u306b\u52b9\u679c\u7684\u306b\u7d71\u5408\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002IaC\u306e\u9069\u7528\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u306e\u52b9\u7387\u3068\u4e00\u8cab\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u4eba\u70ba\u7684\u306a\u30a8\u30e9\u30fc\u306b\u3088\u308b\u30ea\u30b9\u30af\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Terraform\u306e\u7d39\u4ecb<\/h2>\n\n\n\n<p>Terraform\u306fHashiCorp\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u5f37\u529b\u3067\u67d4\u8edf\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308a\u3001\u30b3\u30fc\u30c9\uff08IaC\uff09\u3068\u3057\u3066IT\u30a4\u30f3\u30d5\u30e9\u3092\u81ea\u52d5\u5316\u3057\u3066\u5c55\u958b\u304a\u3088\u3073\u7ba1\u7406\u3057\u307e\u3059\u3002Terraform\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4f01\u696d\u306f\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u3001\u7ba1\u7406\u3001\u304a\u3088\u3073\u4fdd\u5b88\u3092\u52b9\u7387\u5316\u3057\u3001\u30ea\u30b9\u30af\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"484\" src=\"https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11-1024x484.png\" alt=\"\" class=\"wp-image-1914\" srcset=\"https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11-1024x484.png 1024w, https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11-300x142.png 300w, https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11-768x363.png 768w, https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11-18x9.png 18w, https:\/\/pirago.vn\/wp-content\/uploads\/2024\/07\/image-11.png 1181w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">\u30bd\u30fc\u30b9: spacelift.io<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e3b\u306a\u7279\u5fb4\uff1a<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30a4\u30f3\u30d5\u30e9\u3092\u30b3\u30fc\u30c9\u3068\u3057\u3066\u4f5c\u6210\u3001\u5b9a\u7fa9\u3001\u7ba1\u7406\uff1aTerraform\u306f\u30b3\u30fc\u30c9\uff08hcl &#8211; Hashicorp Configuration Language\uff09\u3092\u4f7f\u7528\u3057\u3066\u30a4\u30f3\u30d5\u30e9\u3092\u5b9a\u7fa9\u304a\u3088\u3073\u7ba1\u7406\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u7406\u89e3\u3057\u3084\u3059\u3044\u8a00\u8a9e\u3092\u4f7f\u7528\u3057\u3066\u30ea\u30bd\u30fc\u30b9\u3068\u305d\u306e\u95a2\u4fc2\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u591a\u304f\u306e\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3092\u30b5\u30dd\u30fc\u30c8\uff1aTerraform\u306fAWS\u3001Azure\u3001Google Cloud Platform\u306a\u3069\u306e\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u3001Kubernetes\u306a\u3069\u306e\u30b3\u30f3\u30c6\u30ca\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3001\u304a\u3088\u3073\u305d\u306e\u4ed6\u591a\u304f\u306e\u30aa\u30f3\u30d7\u30ec\u30df\u30b9\u30b7\u30b9\u30c6\u30e0\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30ea\u30bd\u30fc\u30b9\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u306e\u7ba1\u7406\uff1aTerraform\u306f\u30ea\u30bd\u30fc\u30b9\u306e\u5c55\u958b\u3001\u66f4\u65b0\u3001\u304a\u3088\u3073\u524a\u9664\u3092\u5b89\u5168\u304b\u3064\u4e00\u8cab\u3057\u3066\u7ba1\u7406\u3059\u308b\u30c4\u30fc\u30eb\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u81ea\u52d5\u5316\uff1aTerraform\u306f\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u304a\u3088\u3073\u7ba1\u7406\u30d7\u30ed\u30bb\u30b9\u3092\u81ea\u52d5\u5316\u3057\u3001\u4eba\u70ba\u7684\u306a\u30a8\u30e9\u30fc\u3092\u6e1b\u3089\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u4e00\u8cab\u6027\u3092\u9ad8\u3081\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u9ad8\u6027\u80fd\u3068\u62e1\u5f35\u6027\uff1aTerraform\u306f\u5927\u898f\u6a21\u3067\u8907\u96d1\u306a\u30a4\u30f3\u30d5\u30e9\u74b0\u5883\u3092\u51e6\u7406\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3055\u308c\u3066\u304a\u308a\u3001\u4f01\u696d\u306e\u30cb\u30fc\u30ba\u306b\u5fdc\u3058\u3066\u7c21\u5358\u306b\u62e1\u5f35\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u5229\u7528\u306e\u5229\u70b9\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e00\u8cab\u6027\uff1a\u30a4\u30f3\u30d5\u30e9\u74b0\u5883\u304c\u7570\u306a\u308b\u74b0\u5883\uff08\u958b\u767a\u3001\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u3001\u672c\u756a\uff09\u3067\u4e00\u8cab\u3057\u3066\u5c55\u958b\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u6642\u9593\u306e\u7bc0\u7d04\uff1a\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u304a\u3088\u3073\u66f4\u65b0\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u77ed\u7e2e\u3057\u3001\u958b\u767a\u8005\u304a\u3088\u3073\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u8005\u306e\u751f\u7523\u6027\u3092\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u5bb9\u6613\u306a\u7ba1\u7406\uff1a\u5c55\u958b\u304b\u3089\u76e3\u8996\u3001\u4fdd\u5b88\u306b\u81f3\u308b\u307e\u3067\u3001\u30a4\u30f3\u30d5\u30e9\u7ba1\u7406\u306b\u5bfe\u3059\u308b\u7dcf\u5408\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3068\u5236\u5fa1\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">PiraGo\u304cTerraform\u3092\u4f7f\u7528\u3057\u3066AWS\u304a\u3088\u3073GCP\u306b\u30a4\u30f3\u30d5\u30e9\u3092\u5c55\u958b\u3059\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p>1. \u74b0\u5883\u3068\u30c4\u30fc\u30eb\u306e\u6e96\u5099<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.hashicorp.com\/terraform\/tutorials\/aws-get-started\/install-cli\" target=\"_blank\" rel=\"noreferrer noopener\">Terraform\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html\" target=\"_blank\" rel=\"noreferrer noopener\">AWS CLI\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/li>\n<\/ul>\n\n\n\n<p>2. \u72b6\u614b\u306e\u7ba1\u7406<\/p>\n\n\n\n<p>\u30ea\u30e2\u30fc\u30c8\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f7f\u7528\uff1aTerraform\u306e\u72b6\u614b\u7ba1\u7406\u3092\u5b89\u5168\u306b\u884c\u3044\u3001\u30c1\u30fc\u30e0\u5185\u3067\u30a4\u30f3\u30d5\u30e9\u306e\u4f5c\u6210\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306b\u3001\u72b6\u614b\u30921\u3064\u306e\u5834\u6240\u306b\u4fdd\u5b58\u3057\u3001\u5b9a\u671f\u7684\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002AWS\u306e\u5834\u5408\u306fS3\u3001GCP\u306e\u5834\u5408\u306fGoogle Cloud Storage\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>AWS S3\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>terraform {\n    backend \"s3\" {\n        bucket = \"my-terraform-state\"\n        key = \"path\/to\/my\/key\"\n        region = \"us-west-2\"\n        encrypt = true\n    }\n}<\/code><\/pre>\n\n\n\n<p>GCP GCS\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>terraform {\n    backend \"gcs\" {\n        bucket = \"my-terraform-state\"\n        prefix = \"terraform\/state\"\n    }\n}<\/code><\/pre>\n\n\n\n<p>3. Terraform\u3092\u4f7f\u7528\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020<\/p>\n\n\n\n<p><em>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210\u3068\u69cb\u9020<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u251c\u2500\u2500 modules\/\n\u2502   \u251c\u2500\u2500 network\/\n\u2502   \u251c\u2500\u2500 compute\/\n\u2514\u2500\u2500 env\/\n    \u251c\u2500\u2500 common\/\n            \u251c\u2500\u2500 main.tf\n            \u251c\u2500\u2500 variables.tf\n            \u251c\u2500\u2500 outputs.tf\n    \u251c\u2500\u2500 dev\/\n            \u251c\u2500\u2500 main.tf\n            \u251c\u2500\u2500 variables.tf\n            \u251c\u2500\u2500 network.tf\n            \u251c\u2500\u2500 compute.tf\n            \u251c\u2500\u2500 outputs.tf\n    \u2514\u2500\u2500 prod\/\n            \u251c\u2500\u2500 main.tf\n            \u251c\u2500\u2500 variables.tf\n            \u251c\u2500\u2500 network.tf\n            \u251c\u2500\u2500 compute.tf\n            \u251c\u2500\u2500 outputs.tf\n<\/code><\/pre>\n\n\n\n<p>\u30e2\u30b8\u30e5\u30fc\u30eb\u4f5c\u6210\u3057\u3066\u63a1\u7528\u3059\u308b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># modules\/network\/main.tf\n\nvariable \"vpc_cidr\" {}\nresource \"aws_vpc\" \"main\" {\n    cidr_block = var.vpc_cidr\n}\n\n# env\/dev\/network.tf\n\nmodule \"network\" {\n    source = \".\/modules\/network\"\n    vpc_cidr = \"10.0.0.0\/16\"\n}<\/code><\/pre>\n\n\n\n<p>4. \u5c55\u958b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Init\nterraform -chdir=env\/dev init\n\n# \u5909\u66f4\u78ba\u8a8d\nterraform -chdir=env\/dev plan\n\n# \u63a1\u7528\nterraform -chdir=env\/dev apply --auto-approve<\/code><\/pre>\n\n\n\n<p>5. [\u30dc\u30fc\u30ca\u30b9] \u81ea\u52d5\u5316<\/p>\n\n\n\n<p>Terraform\u306f\u3001Jenkins\u3001Github Actions\u3001GitlabCI\u306a\u3069\u306e\u81ea\u52d5\u5316\u30c4\u30fc\u30eb\u306b\u7d71\u5408\u3057\u3066\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u81ea\u52d5\u5c55\u958b\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># .github\/workflows\/terraform.yml\nname: 'Terraform'\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  terraform:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions\/checkout@v2\n\n      - name: Set up Terraform\n        uses: hashicorp\/setup-terraform@v1\n\n      - name: Terraform Init\n        run: terraform init\n\n      - name: Terraform Plan\n        run: terraform plan\n\n      - name: Terraform Apply\n        run: terraform apply -auto-approve<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7d50\u8ad6<\/h2>\n\n\n\n<p>\u4e0a\u8a18\u306e\u5229\u70b9\u3068\u5c0e\u5165\u624b\u9806\u304b\u3089\u3001\u4f01\u696d\u306fAWS\u3068GCP\u4e0a\u3067\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u3092\u52b9\u679c\u7684\u304b\u3064\u5b89\u5168\u306b\u81ea\u52d5\u5c55\u958b\u304a\u3088\u3073\u7ba1\u7406\u3059\u308b\u3079\u304d\u3067\u3059\u3002\u307e\u305f\u3001Terraform\u304c\u4f01\u696d\u306b\u3082\u305f\u3089\u3059\u5229\u70b9\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u5728\u306e\u53b3\u3057\u3044IT\u5e02\u5834\u306b\u304a\u3044\u3066\u3001\u30d9\u30a2\u30e1\u30bf\u30eb\u3084\u30af\u30e9\u30a6\u30c9\u4e0a\u306e\u30b7\u30b9\u30c6\u30e0\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u3068\u904b\u7528\u306b\u304b\u304b\u308b\u6642\u9593\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3059\u308b\u3053\u3068\u304c\u307e\u3059\u307e\u3059\u91cd\u8981\u8996\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f01\u696d\u306f\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u306e\u6642\u9593\u3092\u77ed\u7e2e\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u8fc5\u901f\u306b\u5e02\u5834\u306b\u6295\u5165\u3057\u3001\u3088\u308a\u591a\u304f\u306e\u9867\u5ba2\u306b\u30ea\u30fc\u30c1\u3057\u3001\u58f2\u4e0a\u3092\u5897\u52a0\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u7406\u89e3\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u591a\u304f\u306e\u4f01\u696d\u306f\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u306e\u81ea\u52d5\u5316\u306b\u91cd\u70b9\u3092\u7f6e\u3044\u3066\u304a\u3089\u305a\u3001\u904b\u7528\u4e2d\u306b\u591a\u304f\u306e\u554f\u984c\u304c\u767a\u751f\u3057\u3066\u3044\u307e\u3059\u3002 \u624b\u52d5\u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u306e\u554f\u984c\u70b9 \u30a4\u30f3\u30d5\u30e9\u81ea\u52d5\u5316\u306e\u5fc5\u8981\u6027 \u30a4\u30f3\u30d5\u30e9\u81ea\u52d5\u5316\u306f\u73fe\u4ee3\u306e\u4f01\u696d\u306b\u3068\u3063\u3066\u91cd\u8981\u3067\u3042\u308a\u3001\u624b\u52d5\u30d7\u30ed\u30bb\u30b9\u3092\u81ea\u52d5\u5316\u3059\u308b\u3053\u3068\u3067\u52b9\u7387\u3092\u9ad8\u3081\u3001\u30a8\u30e9\u30fc\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u3001\u30b3\u30b9\u30c8\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3068\u67d4\u8edf\u6027\u306b\u3088\u308a\u3001\u4f01\u696d\u306f\u30d3\u30b8\u30cd\u30b9\u3068\u9867\u5ba2\u306e\u30cb\u30fc\u30ba\u306b\u5fdc\u3058\u3066\u30a4\u30f3\u30d5\u30e9\u3092\u8abf\u6574\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u81ea\u52d5\u5316\u306f\u4e00\u8cab\u6027\u3001\u898f\u5236\u9075\u5b88\u3001\u56de\u5fa9\u529b\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u78ba\u4fdd\u3057\u3001\u7d99\u7d9a\u7684\u304b\u3064\u8fc5\u901f\u306a\u5c55\u958b\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u4f01\u696d\u306f\u904b\u7528\u3092\u6700\u9069\u5316\u3057\u3001\u7af6\u4e89\u529b\u3092\u7dad\u6301\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u81ea\u52d5\u5316\u306b\u304a\u3051\u308bIaC \u30a4\u30f3\u30d5\u30e9\u5c55\u958b\u81ea\u52d5\u5316\u306b\u304a\u3044\u3066\u3001IaC\uff08Infrastructure as Code\uff09\u30c4\u30fc\u30eb\u3068\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306f\u91cd\u8981\u306a\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002IaC\u306f\u3001\u624b\u52d5\u3067\u306f\u306a\u304f\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3001\u304a\u3088\u3073\u95a2\u9023\u30b5\u30fc\u30d3\u30b9\u3092\u7ba1\u7406\u304a\u3088\u3073\u5c55\u958b\u3059\u308b\u624b\u6cd5\u3067\u3059\u3002 IaC\u306e\u4e3b\u306a\u5229\u70b9\uff1a Ansible\u3001Terraform\u3001Chef\u3001Puppet\u306a\u3069\u306eIaC\u30c4\u30fc\u30eb\u3084\u3001\u30b3\u30f3\u30c6\u30ca\u7ba1\u7406\u306e\u305f\u3081\u306eKubernetes\u306a\u3069\u304c\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4f01\u696d\u304cIaC\u3092\u5c0e\u5165\u3059\u308b\u306b\u306f\u660e\u78ba\u306a\u6226\u7565\u304c\u5fc5\u8981\u3067\u3001\u3059\u3079\u3066\u306e\u30ea\u30bd\u30fc\u30b9\u3068\u30d7\u30ed\u30bb\u30b9\u304c\u81ea\u52d5\u5316\u30d7\u30ed\u30bb\u30b9\u306b\u52b9\u679c\u7684\u306b\u7d71\u5408\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002IaC\u306e\u9069\u7528\u306f\u3001\u30a4\u30f3\u30d5\u30e9\u306e\u52b9\u7387\u3068\u4e00\u8cab\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u4eba\u70ba\u7684\u306a\u30a8\u30e9\u30fc\u306b\u3088\u308b\u30ea\u30b9\u30af\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3057\u307e\u3059\u3002 Terraform\u306e\u7d39\u4ecb Terraform\u306fHashiCorp\u306b\u3088\u3063\u3066\u958b\u767a\u3055\u308c\u305f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u5f37\u529b\u3067\u67d4\u8edf\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308a\u3001\u30b3\u30fc\u30c9\uff08IaC\uff09\u3068\u3057\u3066IT\u30a4\u30f3\u30d5\u30e9\u3092\u81ea\u52d5\u5316\u3057\u3066\u5c55\u958b\u304a\u3088\u3073\u7ba1\u7406\u3057\u307e\u3059\u3002Terraform\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4f01\u696d\u306f\u30a4\u30f3\u30d5\u30e9\u306e\u5c55\u958b\u3001\u7ba1\u7406\u3001\u304a\u3088\u3073\u4fdd\u5b88\u3092\u52b9\u7387\u5316\u3057\u3001\u30ea\u30b9\u30af\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3067\u304d\u307e\u3059\u3002 \u4e3b\u306a\u7279\u5fb4\uff1a \u5229\u7528\u306e\u5229\u70b9\uff1a PiraGo\u304cTerraform\u3092\u4f7f\u7528\u3057\u3066AWS\u304a\u3088\u3073GCP\u306b\u30a4\u30f3\u30d5\u30e9\u3092\u5c55\u958b\u3059\u308b\u65b9\u6cd5 1. \u74b0\u5883\u3068\u30c4\u30fc\u30eb\u306e\u6e96\u5099 2. \u72b6\u614b\u306e\u7ba1\u7406 \u30ea\u30e2\u30fc\u30c8\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f7f\u7528\uff1aTerraform\u306e\u72b6\u614b\u7ba1\u7406\u3092\u5b89\u5168\u306b\u884c\u3044\u3001\u30c1\u30fc\u30e0\u5185\u3067\u30a4\u30f3\u30d5\u30e9\u306e\u4f5c\u6210\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306b\u3001\u72b6\u614b\u30921\u3064\u306e\u5834\u6240\u306b\u4fdd\u5b58\u3057\u3001\u5b9a\u671f\u7684\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u307e\u3059\u3002AWS\u306e\u5834\u5408\u306fS3\u3001GCP\u306e\u5834\u5408\u306fGoogle Cloud Storage\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 AWS S3\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f8b\uff1a GCP GCS\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f8b\uff1a 3. Terraform\u3092\u4f7f\u7528\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210\u3068\u69cb\u9020 \u30e2\u30b8\u30e5\u30fc\u30eb\u4f5c\u6210\u3057\u3066\u63a1\u7528\u3059\u308b 4. \u5c55\u958b 5. [\u30dc\u30fc\u30ca\u30b9] \u81ea\u52d5\u5316 Terraform\u306f\u3001Jenkins\u3001Github Actions\u3001GitlabCI\u306a\u3069\u306e\u81ea\u52d5\u5316\u30c4\u30fc\u30eb\u306b\u7d71\u5408\u3057\u3066\u3001\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306e\u81ea\u52d5\u5c55\u958b\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002 \u7d50\u8ad6 \u4e0a\u8a18\u306e\u5229\u70b9\u3068\u5c0e\u5165\u624b\u9806\u304b\u3089\u3001\u4f01\u696d\u306fAWS\u3068GCP\u4e0a\u3067\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u3092\u52b9\u679c\u7684\u304b\u3064\u5b89\u5168\u306b\u81ea\u52d5\u5c55\u958b\u304a\u3088\u3073\u7ba1\u7406\u3059\u308b\u3079\u304d\u3067\u3059\u3002\u307e\u305f\u3001Terraform\u304c\u4f01\u696d\u306b\u3082\u305f\u3089\u3059\u5229\u70b9\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"template":"","class_list":["post-1910","article","type-article","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pirago.vn\/ja\/wp-json\/wp\/v2\/article\/1910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pirago.vn\/ja\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/pirago.vn\/ja\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/pirago.vn\/ja\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/pirago.vn\/ja\/wp-json\/wp\/v2\/media?parent=1910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}