Error viewing report from Terrafrom plan in Merge Request
What are you seeing, and how does that differ from what you expect to see?
When generating a terraform report as an artifact in
.gitlab-ci.yml the report cannot be loaded into the merge request. I expect to see some sort of report embedded in the merge request showing output from the plan.
Instead, I see:
! A terraform report was generated in your pipelines. Changes are unknown.
I also see a red banner:
An error occurred while loading terraform report
artifacts:reports:terraform documentation is extremely brief.
I am on
gitlab.com running the prerelease
13.0.0 in a private repository, using shared runners.
The feature says it is introduced in version
13.0 by https://gitlab.com/gitlab-org/gitlab/-/issues/207528
The job in concern is
plan: stage: plan script: - terraform plan -input=false -out=tfplan tfbackend - terraform show -json tfplan > tfplan.json artifacts: reports: terraform: tfplan.json paths: - tfplan.json expire_in: 5 days only: - merge_requests - staging - master
I have tried several different combinations.
terraform plan -out=tfplan outputs a binary plan. Giving that to the report yielded the same error.
What I currently have produces a good JSON artifact that can be downloaded and viewed, but nothing is embedded in the Merge Request.
https://gitlab.com/gitlab-org/gitlab/-/issues/207526 seems relevant, but I am having a hard time figuring out what is in progress and what I should expect to work.