cli
cli copied to clipboard
Does When its key is <value> support regex in the value?
** Question : ** <A clear describe of your question. Ex, how can I do [...] for [...] with terraform-compliance ?>
Hi,
I have an use case where I need to check if the value of a key is some thing in the list
Ex: main.tf
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PublicRead",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject","s3:PutObject","s3:PutBucket"],
"Resource":["arn:aws:s3:::examplebucket/*"]
}
]
}
test.feature
Scenario Outline: test scenario
........
When its Effect is Allow
And its Action is <value>
And it has Principal
Then its value must not match the "^\*$" regex
Examples:
| value |
| s3:Put.+|
But this scenario is not able to identify the Action parameter values even though I have s3:PutObject and s3:PutBucket
Hi @vrbcntrl,
Only steps that explicitly mention regular expressions support regex evaluation. So When its Action is <value> does not support regular expressions.
Hi @Kudbettin
Thank you for looking into my question.
so, do you think, the support for regex to this particular step would be added in the future?
I have two work in progress solutions but didn't quite like either of them and ended up pushing this issue under the rug. I think before September is a realistic goal, given I'll be back home by then :)
np, thanks for the update.
Hey, are there any updates to this? I have a scenario where it would be super useful to filter by regex.