cloudposse / packages

🏗️ Linux packages for popular DevOps tools. Supports Ubuntu, CentOS, and Alpine.
https://cloudposse.com/accelerate
Apache License 2.0
150 stars 34 forks source link

Add tfupdate #2615

Closed nitrocode closed 4 months ago

nitrocode commented 2 years ago

Have a question? Please checkout our Slack Community in the #geodesic channel or visit our Slack Archive.

Slack Community

Describe the Feature

Easy updating of module dependencies from inside geodesic

https://github.com/minamijoyo/tfupdate

hcledit can be used for this but requires more of a strategic approach where tfupdate is much more convenient

e.g. with hcledit

find . -name remote-state.tf > remote-state-files
cat remote-state-files | \
  while read remotestatefile; do \
    hcledit block list --file $remotestatefile | \
      while read block; do \
        echo "hcledit attribute set $block.version '\"0.22.1\"' --file $remotestatefile -u"; \
        echo "hcledit attribute rm $block.stack_config_local_path --file $remotestatefile -u"; \
      done;
  done > update-remotestate.sh
chmod +x update-remotestate.sh
./update-remotestate.sh

https://github.com/minamijoyo/tfupdate#module

tfupdate module --version "0.23.0" "cloudposse/stack-config/yaml//modules/remote-state" -r .

NOTE: for the above update, we'd still require hcledit to remove the stack_config_local_path but tdupdate is useful for upgrading module versions across a repository

The formula for this should be similar to the following since the tool is created by the same author.

https://github.com/cloudposse/packages/tree/master/vendor/tfschema https://github.com/cloudposse/packages/tree/master/vendor/hcledit

Nuru commented 4 months ago

Closing as wontfix (not going to do it) because there is not enough interest plus, going forward, it is unclear if it contains BSL licensed code.