-
Notifications
You must be signed in to change notification settings - Fork 102
Description
I have setup a github action workflow for pull requests to run terraform plan using the setup-terraform action. If one of the nomad job specifications is syntactically correct, but logically flawed (e.g. setting the address_mode = "driver"
in a service check where the service provider = "nomad"
) the terraform plan command succeeds, but running terraform apply causes an error since the job spec is logically incorrect.
I would like to be able to catch these sorts of things in a PR workflow before they make it to the main branch and the deploy workflow fails.
I am not sure if this is possible since terraform plan
serves a different purpose than nomad plan
(assuming that nomad plan would indeed catch this issue?). But some sort of enhanced command that could run nomad plan to verify that a jobspec is logically correct, and syntactically correct would be nice.
My nomad job files are terraform templates, so I cannot directly run nomad plan using the job file (nor would I really want to, that is kinda the whole point of terraform, multiple data/resource changes and their dependencies can be analyzed together)