https://garden.io logo
#🌱|help-and-getting-started
generateFiles equivalent in Terraform Deploy
# 🌱|help-and-getting-started
b

bored-grass-81679

08/18/2023, 3:39 PM
Hey guys. Is there an equivalent to generateFiles in the Terraform Deploy schema? My use-case is the following: I have Terraform Deploy actions which pull their source files from another repository (specified in source.repository.url). I would like to use a remote Terraform backend for these actions. Garden sadly does not expose a way to configure Terraform state backends. My workaround with Garden modules was using generateFiles to copy a backend.tf file with some templating, into the computed module sources as follows:
Copy code
generateFiles:
  - sourcePath: ./backend-file-name
    targetPath: ./path/to/module/root
    resolveTemplates: True
Is there a way to achieve the same outcome with Garden Actions? Thanks in advance!
q

quaint-dress-831

08/21/2023, 6:05 PM
Hi @bored-grass-81679, I haven't tested this with the Terraform Deploy action type yet but I don't believe we've changed the way
generateFiles
works. The
templated
module are now Config Templates and should work the same but for actions. In fact, the old
templated
modules are converted at runtime to the new Config Templates type. See https://docs.garden.io/using-garden/config-templates
b

bored-grass-81679

08/21/2023, 6:10 PM
Hey @quaint-dress-831 , thanks for the answer! I was including generateFiles in the normal module garden.yaml and was not using any sort of templated modules. Are you saying the same generateFiles field should work in Deploy type actions? Cause I did not find it in the reference: https://docs.garden.io/reference/action-types/deploy/terraform
q

quaint-dress-831

08/21/2023, 6:19 PM
@bored-grass-81679 ah gotcha, apologies for misunderstanding. In that case, it doesn't appear so!
b

bored-grass-81679

08/21/2023, 6:20 PM
@quaint-dress-831 So I stick to modules for now? :<
q

quaint-dress-831

08/21/2023, 6:26 PM
@bored-grass-81679 it looks that way. You have until 0.14 for modules to be dropped completely which should give us plenty of time. I'd consider opening a feature request to re-introduce
generateFiles
to the terraform Deploy action
b

bored-grass-81679

08/21/2023, 6:27 PM
@quaint-dress-831 Or a feature request for managing tf state which I am sure many people would appreciate! Thanks for the quick feedback and have a great rest of the day/evening!
q

quaint-dress-831

08/21/2023, 6:29 PM
Yes, that is also a good one! Thank you and you too! I shall now enjoy a half hour of leisure not playing the new Baldur's Gate because I am stronger than that 😄
2 Views