terraform-compliance / cli

a lightweight, security focused, BDD test framework against terraform.
https://terraform-compliance.com
MIT License
1.34k stars 151 forks source link

Simplify support for running module directly #628

Closed mungojam closed 2 years ago

mungojam commented 2 years ago

I expected to be able to do python -m terraform_compliance as we would with pip or other python tools, but it didn't work. Instead I had to do python -m terraform_compliance.main.

This fixes that problem.

mungojam commented 2 years ago

@eerkunt

eerkunt commented 2 years ago

I am very interested how you invoke terraform-compliance with python. Could be a nice documentation!

mungojam commented 2 years ago

I am very interested how you invoke terraform-compliance with python. Could be a nice documentation!

it's pretty much the same as calling it at the cli:

python -m terraform_compliance <usual-args>

works nicely. This is the same way as pip recommends these days too:

python -m pip install etc.