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

AWS Providerをバージョン4系にアップグレード #69

Merged
merged 6 commits into from
Mar 18, 2022

Conversation

kobayashi-m42
Copy link
Member

@kobayashi-m42 kobayashi-m42 commented Mar 16, 2022

issueURL

#65

Doneの定義

#65 の完了条件が満たされていること

変更点概要

Terraform AWS Provider を現時点での最新バージョン 4.5.0 にアップグレード。
アップグレード手順は記事にまとめたので別途共有する。

補足情報

今後もAWS Privider のバージョンアップ作業が発生すると思うので、実施内容をメモとして残す。

  • versions.tf の required_providers の更新
    versions.tf の required_providers の更新には、minamijoyo/hcledit を利用し、下記のようなshellスクリプトをルートディレクトリに作成し実行。 (ローカルから実行)
for file in $(find . -name 'versions.tf'); do
  echo "$file"
  echo "$(cat $file | hcledit attribute set terraform.required_providers.aws '"4.5.0"')" > $file
done
  • terraform init --upgrade の実行

下記のようなshellスクリプトをルートディレクトリに作成し実行。(Docker上で実行)

current=$(pwd)

for dir in $(find . -maxdepth 5 -regex "\./providers.*/[0-9]\{2,\}.*" -type d); do
  cd "$dir"
  pwd
  terraform init --upgrade

  cd "$current"
done

@kobayashi-m42 kobayashi-m42 self-assigned this Mar 16, 2022
@kobayashi-m42 kobayashi-m42 requested a review from keitakn March 17, 2022 16:22
@kobayashi-m42 kobayashi-m42 marked this pull request as ready for review March 17, 2022 16:22
Copy link
Member

@keitakn keitakn left a comment

Choose a reason for hiding this comment

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

詳細な手順もありがとう🐱:pray:

(それにしても今回の変更、破壊的だな・・・今までで一番かも・・・)

LGTMeow

@kobayashi-m42 kobayashi-m42 merged commit 2aa1d6f into main Mar 18, 2022
@kobayashi-m42 kobayashi-m42 deleted the feature/issue65/upgrade-aws-provider-v4 branch March 18, 2022 02:48
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