Open glenthomas opened 2 years ago
I have same problem, but with "registry.terraform.io/hashicorp/azurerm":
$ terraform-compliance -p ./tfplan --features ./tests/
terraform-compliance v1.3.41 initiated
. Converting terraform plan file.
ERROR: Failed to convert terraform plan file to JSON format via terraform. Here is the error :
None
╷
│ Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain
│ provider schema: Could not load the schema for provider
│ registry.terraform.io/hashicorp/azurerm: failed to instantiate provider
│ "registry.terraform.io/hashicorp/azurerm" to obtain schema: unavailable
│ provider "registry.terraform.io/hashicorp/azurerm"..
╵
Is there some missing action before execute terraform-compliance? Thanks!
Hello, sorry for having this issue.
When you use a plan.out
file generated by terraform directly via terraform plan -out=plan.out
, terraform-compliance
executes terraform
again to convert it to a JSON file. This sometimes take a bit of time and problems like this, as terraform might require to have an init
and other stuff before converting it.
You can skip this step by converting the plan file by yourself with ;
terraform show -json plan.out > plan.out.json
and providing plan.out.json
to terraform-compliance
, instead of plan.out
. terraform-compliance
will detect that this is a converted plan and will skip any terraform
execution. This will both speed up your process and hopefully solves the problem that you are having right now.
Description
I'm not sure if I have done something wrong but am experiencing this error:
To Reproduce
I am using an M1 MacBook
Feature File:
Plan File:
Sample Terraform Code:
Used
terraform-compliance
Parameters:Running via Docker:
Error Output:
Expected Behavior:
It runs my feature tests.
Tested Versions:
Additional Context: