This message was deleted.
# general
b
This message was deleted.
w
Great question and feedback, I think the best option here is to generate the TF plan JSON before the infracost-job then set plan.json file as the
variables.path
for the infracost-job. That way you can customise how you run init. We documented this for the GH Action as someone had a similar requirement there. Would that help?
l
Looks like there's a
gitlab-terraform
helper as well that can help generate the plan JSON (https://docs.gitlab.com/ee/user/infrastructure/mr_integration.html#example-gitlab-ciyml-file). @white-airport-8778 what do you think about adding an issue for supporting
--terraform-init-flags
? I think it would probably be the best way of handling this case going forward.
b
Yes I'm using the
gitlab-terraform
helper for the terraform part of the jobs
🙌 1
I will try to use the generated
plan.json
and let you know 😉
w
I’m wondering if it’s simpler to have 1 method that works in all cases vs “try the TF directory option first and if that doesn’t work fall back to generating your own plan JSON”, e.g. someone from the community had an issue with Atlantis and not setting their workspace so I tweaked the docs to add a note (they eventually figured out that they needed to set the workspace but it was probably harder to debug as it initially looked like Infracost was failing). But maybe I’m over-thinking this and
--terraform-init-flags
is simpler to use.
b
and perhaps, more consistent regarding the current
--terraform-plan-flags
😉 because I have to admit that I have been looking for
--terraform-init-flags
directly after encountering this issue
👍 1