StyraInc / opa-aws-cloudformation-hook

AWS Cloudformation Hook for OPA-powered infrastructure policy enforcement
Apache License 2.0
35 stars 5 forks source link

Add more examples #11

Closed peteroneilljr closed 2 years ago

peteroneilljr commented 2 years ago

The tests are the same, but I can't seem to get them to pass. There is something in the dynamic testing system I guess I don't fully understand. Can you take a look @anderseknert ?

anderseknert commented 2 years ago

@peteroneilljr The policies should be moved from the templates directory (as we'll use them for only templates from now on) and into the policy directory.

As for the dynamic part, you'll need to rename the package of each policy to reflect the type of the resource, so that e.g. a policy to work with AWS::S3::Bucket will have a package name like package aws.s3.bucket.

Once that's done, we can take it from there :) There were a few helpers added and simplified for testing, so we might need to tweak your tests to use those, but besides that it shouldn't be anything major.

peteroneilljr commented 2 years ago

I'm not sure why my changes are not showing up in this PR. They have been pushed, anyway I'm just created a new PR instead.

https://github.com/StyraInc/aws-cloudformation-python/pull/13