rough-lamp-14794
05/24/2024, 9:41 AMlittle-author-61621
terraform show -json
first.rough-lamp-14794
05/24/2024, 9:49 AMterraform show -json
and then run breakdonw ?little-author-61621
infracost breakdown --path=path/to/repo
rough-lamp-14794
05/24/2024, 9:54 AMinfracost diff
in my git lab pipeline which store the state in gitlab.
I am able to do the breakdown it is good , I want to do the diff on my feature branch whenever i update the code .
right now i am downloading the state form gitlab and doing below
download the existing statefile {prj}-{env}-{target}.json
mv {prj}-{env}-{target}.json terraform.tfstate
terraform show -json > {prj}-{env}-{target}-state.json
infracost breakdown --path statefile {prj}-{env}-{target}-state.json --format json --out-file estimate-{prj}-{env}-{target}-state.json
rm terraform.tfstate
infracost diff --path . --compare-to {prj}-{env}-{target}-state
is there any better way ? so that i can avoide the statefile download using api call?little-author-61621