digger icon indicating copy to clipboard operation
digger copied to clipboard

Supporting Asdf

Open motatoes opened this issue 2 years ago • 2 comments

asdf has the same idea as tfenv with the only difference - asdf supports hundreds of different tools, including terraform and terragrunt.

digger should support Asdf based projects, in this case it will invoke the following commands in each terraform directory:

asdf plugin add terraform
asdf install # per every terraform project defined in digger configuration file
terraform plan/apply

The responsibility of installing asdf within the image can be handled by the user, before digger is invoked, so we can assume that the user has already installed asdf prior to invoking digger

This is similar to our support for tfenv.

motatoes avatar Aug 02 '23 10:08 motatoes

https://github.com/asdf-vm/actions should take care of this, right? So the docs just need to mention something about adding this into the workflow?

  - uses: asdf-vm/actions/install@v3

Then it should just work as long as the user specifies terraform as a tool, or if they specify opentofu and set opentofu=true in the relevant digger.yaml project. Right?

dannysauer avatar Mar 10 '25 20:03 dannysauer

Follow-up: I've been using the asdf install action for a little bit, and it works. The "official" action will generate a bunch of extra warnings in the action log due to using an old version of asdf, but an updated version fixing that should be released as v4 "soon". See the comment on the asdf version bump PR and the pending release PR.

The main drawback to using the action right now is that it requires .tool-versions to be used from the root of the repository rather than allowing one to use a version file in a specific directory. It's conceivable that one could have different versions in separate projects. If https://github.com/asdf-vm/actions/issues/586 was implemented, then one could use job.projectDir from the spec. 🤷

dannysauer avatar Mar 25 '25 15:03 dannysauer