{"id":3155,"date":"2022-10-26T09:57:55","date_gmt":"2022-10-26T00:57:55","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/?p=3155"},"modified":"2022-10-26T12:14:32","modified_gmt":"2022-10-26T03:14:32","slug":"github_actions","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2022\/10\/26\/github_actions\/","title":{"rendered":"GitHub Actions\u3067Terraform\u306eCI\/CD\u3092\u3084\u3063\u3066\u307f\u305f"},"content":{"rendered":"

\u3053\u3093\u306b\u3061\u306f\uff01\u9ed2\u7530\u3053\u3068\u30af\u30ed\u3061\u3083\u3093\u3067\u3059\u3002
\n\uff08\u3053\u308c\u304b\u3089\u306f\u793e\u5185\u3067\u547c\u3070\u308c\u3066\u3044\u308b\u30cb\u30c3\u30af\u30cd\u30fc\u30e0\u300c\u30af\u30ed\u3061\u3083\u3093\u300d\u3067\u57f7\u7b46\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002\uff09<\/p>\n

\u4eca\u56de\u306f\u3001GitHub Actions\u3067Terraform\u306eCI\/CD\u3092\u69cb\u7bc9\u3057\u305f\u969b\u306e\u8a71\u3092\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002
\n\u4f3c\u305f\u5185\u5bb9\u306e\u8a18\u4e8b\u306f\u3001\u65e2\u306b\u8272\u3005\u3068\u5b58\u5728\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001
\n\u7279\u306b\u30d6\u30e9\u30f3\u30c1\u904b\u7528\u3068CI\/CD\u306e\u6d41\u308c\u3001\u4f5c\u696d\u4e2d\u611f\u3058\u305f\u7559\u610f\u70b9\u3092\u539a\u3081\u306b\u66f8\u3044\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\uff01<\/p>\n

\u69cb\u7bc9\u7d4c\u7def<\/h2>\n

\u300cpush\u3057\u305fTerraform\u306e\u30b3\u30fc\u30c9\u306b\u5bfe\u3057\u3066plan\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u305d\u306e\u5185\u5bb9\u3092\u7c21\u5358\u306bSlack\u3078\u901a\u77e5\u3057\u305f\u3044\u300d
\n\u305d\u3093\u306a\u304d\u3063\u304b\u3051\u304b\u3089\u59cb\u307e\u3063\u3066\u3001GitHub Actions\u3092\u8a66\u3057\u306b\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u3044\u3046\u6b32\u6c42\u304c\u91cd\u306a\u308a\u3001
\n\u4eca\u56de\u306eGitHub Actions\u3092\u4f7f\u3063\u305fCI\/CD\u306e\u69cb\u7bc9\u306b\u81f3\u308a\u307e\u3057\u305f\u3002<\/p>\n

GitHub Actions\u306f\u3001\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u4ed6\u306e\u65b9\u304c\u5b9f\u88c5\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002
\n\u4eca\u56de\u306f\u3001OIDC\u3067AWS\u306e\u8a8d\u8a3c\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u3001Terraform\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u3001Slack\u901a\u77e5\u3059\u308b\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3055\u305b\u3066\u9802\u304d\u307e\u3057\u305f\u3002
\n\u4ed6\u306b\u3082\u4fbf\u5229\u306a\u30a2\u30af\u30b7\u30e7\u30f3\u306f\u3001GitHub\u306eMarketplace<\/a>\u304b\u3089\u691c\u7d22\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n

\u30d6\u30e9\u30f3\u30c1\u904b\u7528\u3068CI\/CD\u306e\u6d41\u308c<\/h2>\n

\u30d6\u30e9\u30f3\u30c1\u904b\u7528\u3068CI\/CD\u306e\u6d41\u308c\u3067\u3059\u304c\u3001\u7c21\u5358\u306b\u56f3\u306b\u3059\u308b\u3068\u4ee5\u4e0b\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002
\nMain\u30d6\u30e9\u30f3\u30c1\u306f\u3001AWS\u3078\u30c7\u30d7\u30ed\u30a4\u3055\u308c\u3066\u3044\u308bTerraform\u306e\u30b3\u30fc\u30c9\u304c\u7ba1\u7406\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n

\"\"<\/p>\n

\u5b9f\u88c5\u4f5c\u696d\u306e\u6d41\u308c\u3092\u7d30\u304b\u304f\u8aac\u660e\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n

    \n
  1. Main\u30d6\u30e9\u30f3\u30c1\u304b\u3089\u4f5c\u696d\u30d6\u30e9\u30f3\u30c8\u3092\u5207\u3063\u3066\u3001\u305d\u3053\u3067\u4f5c\u696d\u3092\u3057\u3066\u3082\u3089\u3044\u307e\u3059<\/li>\n
  2. \u5909\u66f4\u5185\u5bb9\u306f\u9069\u5b9c\u30d7\u30c3\u30b7\u30e5\u3057\u307e\u3059<\/li>\n
  3. \u30d7\u30c3\u30b7\u30e5\u3055\u308c\u305f\u3089GitHub Actions\u3067plan\u3092\u5b9f\u884c\u3057\u3001\u7d50\u679c\u306fSlack\u3078\u901a\u77e5\u3057\u307e\u3059<\/li>\n
  4. \u4f5c\u696d\u304c\u7d42\u4e86\u3057\u305f\u3089\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51fa\u3057\u307e\u3059<\/li>\n
  5. \u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u627f\u8a8d\u3055\u308c\u305f\u3089\u3001\u4f5c\u696d\u30d6\u30e9\u30f3\u30c1\u3092Main\u30d6\u30e9\u30f3\u30c1\u3078\u30de\u30fc\u30b8\u3057\u307e\u3059<\/li>\n
  6. \u30de\u30fc\u30b8\u3055\u308c\u305f\u3089GitHub Actions\u3067apply\u3092\u5b9f\u884c\u3057\u3066\u3001AWS\u3078\u5909\u66f4\u5185\u5bb9\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059<\/li>\n<\/ol>\n

    \u8907\u6570\u4eba\u3067\u540c\u6642\u306b\u4f5c\u696d\u3059\u308b\u5834\u5408\u3001tfstate\u30d5\u30a1\u30a4\u30eb\u306f\u5916\u90e8\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u5207\u308a\u51fa\u3057\u3066\u3044\u306a\u3044\u3068
    \n\u5dee\u5206\u7ba1\u7406\u304c\u9762\u5012\u306b\u306a\u308a\u307e\u3059\u3002
    \n\u3067\u3059\u306e\u3067\u3001tfstate\u30d5\u30a1\u30a4\u30eb\u306fS3\u3067\u7ba1\u7406\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n

    GitHub Actions\u306e\u4e2d\u8eab<\/h2>\n

    \u524d\u9805\u3067\u8aac\u660e\u3057\u305f\u30d5\u30ed\u30fc\u3092\u5b9f\u73fe\u3059\u308b\u3079\u304f\u3001\u5b9f\u88c5\u3057\u305fGitHub Actions\u306f\u4ee5\u4e0b\u306e\u7bc0\u306e\u901a\u308a\u3067\u3059\u3002
    \n\u5b9f\u969b\u306f\u3001\u5171\u901a\u90e8\u5206\u3092\u5225\u30d5\u30a1\u30a4\u30eb\u306b\u5207\u308a\u51fa\u3059\u7b49\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001
    \n\u8af8\u4e8b\u60c5\u306b\u3088\u308a\u30d6\u30ed\u30b0\u306b\u63b2\u8f09\u3057\u3084\u3059\u3044\u5f62\u3078\u7de8\u96c6\u3057\u307e\u3057\u305f\u3002<\/p>\n

    \u300c\u3069\u306e\u90e8\u5206\u3067\u4f55\u3092\u3057\u3066\u3044\u308b\u304b\u300d\u306f\u30b3\u30e1\u30f3\u30c8\u3092\u7d30\u304b\u304f\u66f8\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u78ba\u8a8d\u3044\u305f\u3060\u3051\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n

    \u306a\u304a\u3001\u4ee5\u4e0b\u306e\u60c5\u5831\u306fGitHub\u306eSecrets\u306b\u767b\u9332\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n