packages icon indicating copy to clipboard operation
packages copied to clipboard

Add tfupdate

Open nitrocode opened this issue 3 years ago • 0 comments

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

nitrocode avatar Jun 29 '22 12:06 nitrocode