suzuki-shunsuke / tfaction

Framework for Monorepo to build high level Terraform Workflows by GitHub Actions
https://suzuki-shunsuke.github.io/tfaction/docs/
MIT License
265 stars 40 forks source link

Run tfaction if file outside of working directory changes #1721

Open florianmutter opened 3 months ago

florianmutter commented 3 months ago

Feature Overview

We would like to run tfaction if files in a specific folder outside of the working dir is changed.

Why is the feature needed?

We get secret values from a single directory /secret for all environments. Those secrets are read by terraform. With the current setup tfaction does not run if a secret is changed.

Example Code

GitHub Actions

tfaction-root.yaml

tfaction.yaml

Note

We found https://suzuki-shunsuke.github.io/tfaction/docs/feature/local-path-module but this seems to only work for modules. We would like the same feature but in a more generic way.

suzuki-shunsuke commented 3 months ago

Thank you for your proposal. It's convenient but complicated to parse Terraform configuration and resolve dependencies automatically, so it's nice if we can define dependencies explicitly somehow.

For example, we may be able to define dependencies in tfaciton.yaml. Note that the following codes are just example.

tfaciton.yaml

dependencies:
  - ../common
  - ../../secrets