Given a terraform/modules directory tree, we would like to globally update the minimum required terraform version in all modules.

  • Option 1: Use ack or fd + sed.
  • Option 2: Use tfupdate, which can be installed via homebrew or your favorite package manager (c.f. repology).
$ tfupdate terraform -r terraform/modules -v '~> 1.6.6'