terraform-compliance / cli

a lightweight, security focused, BDD test framework against terraform.
https://terraform-compliance.com
MIT License
1.34k stars 151 forks source link

Add support for testing the terraform block #696

Open harleypig opened 1 year ago

harleypig commented 1 year ago

Feature Request

Feature description: Support testing the terraform {} block, to ensure a minimum version, specific providers and versions, etc.

Suggested Solution description ( if you have any ): I'm not sure how the code is using the plan, so can't offer a suggestion here.

Essentially, I'd like to test that

terraform {
  required_version = ">=1.3.2"
  required_providers {
    blah blah
  }
}

contains a specific version check and specific providers.

harleypig commented 1 year ago

This might be related to #574