Skip to content

Feature Request: Plan Nomad Job on terraform plan #539

@andyslucky

Description

@andyslucky

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions