使用 Dependabot 把 Terraform 的提供者版本更新

Dependabot现在支持Terraform 1.0的provider和module。

Dependabot now supports Terraform 1.0

只需按照以下设置,Dependabot就会为您创建拉取请求。

version: 2

updates:
  - package-ecosystem: terraform
    directory: /
    schedule:
      interval: monthly
image.png

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

image.png

如果您使用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 }}
广告
将在 10 秒后关闭
bannerAds