Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform-init.sh を最新の状態に更新 #44

Merged
merged 3 commits into from
Sep 26, 2021

Conversation

keitakn
Copy link
Member

@keitakn keitakn commented Sep 17, 2021

issueURL

#43

関連URL

なし

Doneの定義

変更点概要

terraform-init.sh を今のディレクトリ構成に合わせて最新に更新、またREADMEに書かれているディレクトリ名やパスが以前のままだったので今の状態に合わせて更新。

レビュアーに重点的にチェックして欲しい点

@kobayashi-m42 動作確認済だけど、念の為、READMEの記述(環境変数ファイルのパスとか)が間違っていないか確認してもらえると:pray:

補足情報

@kobayashi-m42 今回のPRとは関係ないけど、 terraform plan でいくつか差分が出たんだけど、これって単純に ignore_changes しちゃって大丈夫かな?もし方針問題なければ、issue作って対応しようかなと🐱!

/data/providers/aws/environments/prod/12-images

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # module.images.aws_cloudfront_origin_access_identity.lgtm_images_bucket has been changed
  ~ resource "aws_cloudfront_origin_access_identity" "lgtm_images_bucket" {
      ~ etag                            = "EXXXXXXXXXXXX" -> "EYYYYYYYYYYYY"
        id                              = "EAAAAAAAAAAAA"
        # (5 unchanged attributes hidden)
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to
undo or respond to these changes.

/data/providers/aws/environments/prod/22-migration

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # module.migration.aws_ecs_cluster.migration has been changed
  ~ resource "aws_ecs_cluster" "migration" {
        id                 = "arn:aws:ecs:ap-northeast-1:0000000000:cluster/lgtm-cat-migration-cluster"
        name               = "lgtm-cat-migration-cluster"
        tags               = {}
        # (3 unchanged attributes hidden)

      - setting {
          - name  = "containerInsights" -> null
          - value = "disabled" -> null
        }
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to
undo or respond to these changes.

/data/providers/aws/environments/prod/23-rds

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # module.rds.aws_ecs_cluster.bastion has been changed
  ~ resource "aws_ecs_cluster" "bastion" {
        id                 = "arn:aws:ecs:ap-northeast-1:0000000000:cluster/lgtm-cat-bastion-cluster"
        name               = "lgtm-cat-bastion-cluster"
        tags               = {}
        # (3 unchanged attributes hidden)


      - setting {
          - name  = "containerInsights" -> null
          - value = "disabled" -> null
        }
        # (1 unchanged block hidden)
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to
undo or respond to these changes.

@keitakn keitakn self-assigned this Sep 17, 2021
@keitakn keitakn marked this pull request as ready for review September 17, 2021 05:54
@kobayashi-m42
Copy link
Member

@keitakn

今回のPRとは関係ないけど、 terraform plan でいくつか差分が出たんだけど、これって単純に ignore_changes しちゃって大丈夫かな?もし方針問題なければ、issue作って対応しようかなと🐱!

Version 0.15.4からTerraform外でリソースを更新した場合に、差分が表示されるようになった影響だと思う!
(ただ、AWSコンソールから変更したとき以外にもこの差分が発生することがあって、どのタイミングで差分は発生しているのかよくわかっていない。)

参考: https://dev.classmethod.jp/articles/terraform-015/

terraform planの結果、リソース自体の差分がなければterraform apply -refresh-onlyを実行して、stateファイルを更新してしまっていいと思う!

具体的には、下記のメッセージが表示されるケース🐱

No changes. Your infrastructure matches the configuration.

Your configuration already matches the changes detected above. If you'd like to update the Terraform state to match, create and apply a refresh-only plan:
  terraform apply -refresh-only

Copy link
Member

@kobayashi-m42 kobayashi-m42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正ありがとう!
LGTMeow

@keitakn
Copy link
Member Author

keitakn commented Sep 26, 2021

@kobayashi-m42 #44 (comment)

情報ありがとう🐱

なるほど、0.15.4 からだから割と最近こうなったんだね、READMEにも書いておいたほうが良さそうだから #45 で追記しておくね👍

@keitakn keitakn merged commit 67ac285 into main Sep 26, 2021
@keitakn keitakn deleted the feature/issue43/update-erraform-init-sh branch September 26, 2021 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants