Open TomTucka opened 3 years ago
I think it has to do with the following
terraform-compliance will have to be tweaked a bit more to be able to process the plan output of any terraform >= 15.4 more effectively as a past release was supposed to support terraform 1.0 plans
I believe my error might be similar
terraform-compliance v1.3.18 initiated
. Converting terraform plan file.
. Downloading terraform v0.15.4 from https://releases.hashicorp.com/terraform/0.15.4/terraform_0.15.4_linux_amd64.zip ...
. Unpacking /tmp/terraform_0.15.4_linux_amd64.zip
. Converting terraform plan file.
. Using /tmp/terraform_0.15.4_linux_amd64 as terraform executable.
None
╷
│ Error: Could not load plugin
│
│
│ Plugin reinitialization required. Please run "terraform init".
│
│ Plugins are external binaries that Terraform uses to access and manipulate
│ resources. The configuration provided requires plugins which can't be
│ located,
│ don't satisfy the version constraints, or are otherwise incompatible.
│
│ Terraform automatically discovers provider requirements from your
│ configuration, including providers used in child modules. To see the
│ requirements and constraints, run "terraform providers".
│
│ 2 problems:
│
│ - failed to instantiate provider "registry.terraform.io/hashicorp/archive"
│ to obtain schema: unknown provider
│ "registry.terraform.io/hashicorp/archive"
│ - failed to instantiate provider "registry.terraform.io/hashicorp/aws" to
│ obtain schema: unknown provider "registry.terraform.io/hashicorp/aws"
│
╵
. Plan file has been created by terraform v0.15.4, but you have v1.0.0
ERROR: Failed to convert terraform plan file to JSON format via terraform. Here is the error :
terraform-compliance version: v1.3.18 terraform version: v0.15.4
This could be similar. Looks like 1.0.x releases are creating quite a lot problem.
Will have a deeper look on this.
Hi @TomTucka , did you try the same with the latest 1.x version of terraform
? It looks like its fixed on the terraform side.
@Shocktrooper can you also run which terraform
please ? It looks like, you have the plan.out
file only. In order to get it parsed by terraform-compliance
, we use terraform
executable to convert it to a JSON file. (command: terraform show -json plan.out > plan.out.json
) terraform
requires a terraform init
before converting it to JSON file, unfortunately this is not a functionality where terraform-compliance
can interfere. On the other hand, if you convert it to JSON and give plan.out.json
instead of plan.out
to terraform-compliance
, we won't need any conversion and this problem won't occur.
@eerkunt I have verified that passing in the JSON works with the latest version of terraform-compliance with terraform 15.4 . It appears that since we use terragrunt that terraform-compliance was unable to do anything when it tried to auto init what was in the directory
Description
Heya, Since when upgrading to Terraform 1.0 our pipeline has started failing with the below error. We're using the latest version of your github action. Any ideas as to what could be the issue?
To Reproduce
Used
terraform-compliance
Parameters:terraform-compliance --features tests --planfile my.plan
Error Output:
Expected Behavior:
Tested Versions:
v1.3.18
1.0
Additional Context: