Closed meraj-kashi closed 5 months ago
Hi @meraj-kashi the problem is you are using the test
command. This is not the structure the test command expects. The test
command is for writing unit tests for your cfn-guard rules. If you are looking to validate the template, please use the validate command.
Please let me know if there is anything else I can do to help.
Hi @meraj-kashi I am going to go ahead and close out this issue. Feel free to re-open if need be.
Thanks
Hi! I am trying to use the
cfn-guard
tool to validate Terraform resources. The below sample s3 terraform resource:According to the
cfn-guard
native behaviour, I create a JSON output file of the Terraform resources using the commands below:As a simple proof of concept (PoC), I am trying to validate if the AWS S3 resource contains tags or not. First, let's look at the JSON file created using the above commands:
Now, creating the below guard definition to detect the s3 resource without tags:
And finally using
cfn-guard
cli to test the JSON file:Then getting the below error message which looks like complain about the JSON:
As you can see, the JSON file has a valid format (already validated by another tool), so I cannot find the issue. I would appreciate it if you could help me identify the problem. Additionally, are there any examples of Terraform validation?
Extra details: