Templated Entities

terraform-compliance supports native resource type referencing that can be used as same in your tests and terraform code.

For example a test against this terraform code ;

resource "aws_s3_bucket" "my-bucket" {
  bucket = "some-bucket-name"
  acl    = "private"

  ...
}

can be written as ;

Feature: My test feature

Scenario: Ensure my specific s3 buckets are private
  Given I have aws_s3_bucket defined
  Then it must contain acl
  And its value must be private

While this is quite easy to understand, you can also write the same test as ;

Feature: My test feature

Scenario: Ensure my specific s3 buckets are private
  Given I have AWS S3 Bucket defined
  Then it must contain acl
  And its value must be private

where we used ;

  Given I have AWS S3 Bucket defined

instead of ;

  Given I have aws_s3_bucket defined

There are few templated entities defined for making the tests more readable. Some about resource types, some about properties of resources.

Complete list can be found on github repository


terraform-compliance made with . Distributed by an MIT license.