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 :
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 :
key Description Examples name name of the resource. The name must point to a resource. Can not be provideror anything else.aws_security_groupaws_s3_bucket
Given I have resource that supports something
Possible sentences :
Possible Name values
You may use the additional values for name in addition to any Terrafrom resource type:
▪
a resource,any resource,resources▪
an output,any output,outputs▪
a variable,any variable,variables