Comments (8)
Thank you so much @eerkunt .
I have tested the above BDD with v 1.0.7 and both positive and negatives tests are working as expected.
I also tested the use case mentioned in #93 and it is also working fine.
Thanks again!
from cli.
Thanks for reporting @vrbcntrl. The problem is due to inline configuration in terraform. Unfortunately, inline configuration is not supported, since it may vary a lot!
This feature might be supported after having #72 and #66.
from cli.
Thank you @eerkunt for the response. I'll wait for the update from you then :)
from cli.
This should be fixed in 1.0.0
. Please let us know if it doesn't work for you.
from cli.
Hi @eerkunt ,
I have again tested this use case with 1.0.4, unfortunately it still throws me a different error now
Scenario: AWS EMR Encryption at Rest Given I have aws_emr_security_configuration defined When it contains configuration Then encryption must be enabled KeyError: 'type'
Please find my tf template, out file and the results in the attachments.
In this case also, I have 2 encryption properties that I want to test, but I suppose I cant use the above scenario, so I have also tried the scenario outline just like I have tried in #93 but that also throws me error...
aws_emr_security_configuration.zip
from cli.
Thanks for trying it again. #101 introduces a fix and enhancement on these kind of conditions. Now we support heredoc json strings. Please have a try with 1.0.5
and let me know if it doesn't work for you ?
from cli.
Thanks @eerkunt for fixing the issue. The new version 1.0.5 works fine if I wanted to test a single encryption property i.e 'aws_emr_security_configuration': 'EnableAtRestEncryption'
because this is configure in init.py , however I have 2 encryption properties in the same json as shown below
"EnableInTransitEncryption": false, "EnableAtRestEncryption": false
so I tried to test them using the same technique used for #93 , however it didn't work :(
` Scenario Ouline: AWS EMR Encryption at Rest
Given I have aws_emr_security_configuration defined
When it contains configuration
Then it must contain
Examples:
| encryption |
| EnableInTransitEncryption |
| EnableAtRestEncryption |`
I got the below error:
`Error Oracle says:
There is no step defintion for 'Then it must contain '.
All steps should be declared in a module located in c:\users\vrb.cntrl\appdata\local\programs\python\python37\lib\site-packages\terraform_compliance\steps.
For example you could do:
@step(r"Then it must contain ")
def my_step(step):
raise NotImplementedError("This step is not implemented yet")`
so, if you could let me know how to test the 2 or 3 related properties in the same resource, that would be really helpful...thanks in advance!
from cli.
There are multiple problems here.
- Your BDD test is wrong, there are both some typos and it s not structured correctly. I think you are trying to achieve this ;
Scenario Outline: AWS EMR Encryption at Rest and In-Flight
Given I have aws_emr_security_configuration defined
When it contains configuration
Then it must contain <encryption>
Then its value must match the "<value>" regex
Examples:
| encryption | value |
| EnableInTransitEncryption | true |
| EnableAtRestEncryption | true |
- There was a case where
Boolean
values were not checked onThen its value must match the "<value>" regex
step. It is not fixed on #103.
Could you please try with 1.0.6
and the BDD test above together ?
from cli.
Related Issues (20)
- cleanup tmp HOT 3
- --coverage flag with docker HOT 1
- FATAL ERROR: Unsupported terraform version (1.4.0). HOT 4
- Support for Terraform 1.4.* HOT 2
- Add support for testing the terraform block HOT 1
- tagging feature - false positive for aws_lambda_function's "environment" argument HOT 2
- Terregarrunt support
- Applying test cases to only resources from specific provider HOT 1
- Support for Terraform 1.5.* HOT 8
- Can not find aws_msk_cluster defined in target terraform plan
- Question: Using Terraform Compliance in CircleCI with Terraform and Python Orbs HOT 4
- Add support for Terraform Version 1.6.0 HOT 4
- Is `or` logic supported at all? HOT 1
- STDERR isn't being used, log level cannot be changed.
- THEN's condition matches for child properties in absence of a property at expected level. Is this expected? HOT 1
- 'AttributeError: 'str' object has no attribute 'append'' HOT 2
- "AttributeError: 'dict' object has no attribute 'startswith'" when using resources defining their own "references" blocks
- FATAL ERROR: Unsupported terraform version (1.7.0)
- Get rid of "/root/.cache" directory
- When condition on resource which has its own type property fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.