Link Search Menu Expand Document

GIVEN

GIVEN directive is use to set the initial standard about the type of the entity that you are searching for. Every Scenario must have a GIVEN as the first step defining the context.

If the scenario starts with Given I have aws_s3_bucket defined, the step below will have all the aws_s3_bucket resources defined in its context.

Few examples can be ;

Given I have AWS S3 Bucket defined
Given I have aws_s3_bucket defined
Given I have any resource defined

You can not use AND with GIVEN.

or depending on use a Scenario Outline instead of a Scenario, it can also be a variable like ;

Given I have <resource_type> defined

Reference

Given I have name type configured

Possible sentences :

Given I have name type configured

key Description Examples
name name of the key in terraform. aws_security_group ingress

In order to define all resources, you can also use ;

a resource any resource a any anything
type The type of the key. It can be one of these ;
resource resources provider providers data datas variable variables

Please note, Given I have any resource can be used to capture all resources.

Given I have any resource defined
When its provider_name is aws
...

Will run following steps on all aws resources.


Given I have name defined

Possible sentences :

Given I have name defined

key Description Examples
name name of the resource. The name must point to a resource. Can not be provider or anything else. aws_security_group aws_s3_bucket

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