Errors reading state files generated by terraform aws provider 5.*
Description When running driftctl against a state file stored by the most recent version of the terraform aws provider (now on 5.* as of recently), driftctl complains of errors reading from the state file and fails to complete.
Environment
- OS: Wolfi (container)
- driftctl version: v0.39.0
- terraform version: 1.4.6
- terraform providers versions: [email protected]
How to reproduce Create a few resources using terraform. Any one of these will fail:
-
aws_route_table-> this will yield a"route": element 0: attribute "instance_id" is requirederror -
aws_default_vpc-> this will yield aattributes "enable_classiclink" and "enable_classiclink_dns_support" are requirederror
Possible Solution Update to the most recent version of the terraform state file parsing library from hashicorp.
Could you please tell me how you solved the issue?
Could you please tell me how you solved the issue?
We gave up on using driftctl, and use a combination of AWS Security Hub controls, custom lambdas, and some other custom bits. https://github.com/prowler-cloud/prowler/issues/2678 would be nice.
If anyone else finds this, we were able to solve it by passing the appropriate tf-provider-version
DCTL_TF_PROVIDER_VERSION=5.52.0 driftctl scan