minamijoyo / tfupdate

Update version constraints in your Terraform configurations
MIT License
542 stars 23 forks source link

Add support for Terraform Registry Module as a release data source #15

Closed minamijoyo closed 4 years ago

minamijoyo commented 4 years ago

Add --source-type tfregistryModule to the release latest command to allow us to get the latest version number of a given module from Terraform Registry.

$ tfupdate release latest --source-type tfregistryModule terraform-aws-modules/vpc/aws
2.24.0

To avoid depending on a specific version of Terraform, we implement a pure Terraform Registry API client. https://www.terraform.io/docs/registry/api.html

Currently only the official public registry is supported. There are other APIs and request/response fields, but we define only the ones we need here to keep it simple. The service discovery protocol is also not implemented for now.