4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

DependabotでTerraformのproviderのバージョンを上げる

Posted at

DependabotがTerraformのproviderとmoduleに対応してました。
https://github.blog/changelog/2021-06-10-dependabot-now-supports-terraform-1-0/

以下のように設定することで、DependabotがPRを出してくれるようになります。

.github/dependabot.yml
version: 2

updates:
  - package-ecosystem: terraform
    directory: /
    schedule:
      interval: monthly

image.png

terraform init -upgrade を実行して .terraform.lock.hcl を更新しなくてよくなるのが楽ですね。

image.png

Terraform Cloud等、Privateなmodule registryを使っている場合は、以下のように設定します。
TOKEN はSettings > Secrets > Dependabotから設定します。

.github/dependabot.yml
version: 2

updates:
  - package-ecosystem: terraform
    directory: /
    schedule:
      interval: monthly
    registries:
      - terraform-cloud

registries:
  terraform-cloud:
    type: terraform-registry
    url: https://app.terraform.io
    token: ${{ secrets.TOKEN }}
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?