使用 Dependabot 把 Terraform 的提供者版本更新
Dependabot现在支持Terraform 1.0的provider和module。
只需按照以下设置,Dependabot就会为您创建拉取请求。
version: 2
updates:
- package-ecosystem: terraform
directory: /
schedule:
interval: monthly

运行 `terraform init -upgrade` 可以轻松更新`.terraform.lock.hcl`,真是方便啊。

如果您使用Terraform Cloud等以及私有的模块注册表,可以按照以下方式进行配置。
TOKEN应通过Settings > Secrets > Dependabot进行设置。
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 }}