pulumi / pulumi-policy-aws

A policy pack of rules to enforce AWS best practices for security, reliability, cost, and more!
https://www.pulumi.com
Apache License 2.0
34 stars 6 forks source link

Add dynamodb policies #26

Closed ekrengel closed 4 years ago

ekrengel commented 4 years ago

Addresses some of policies in #11

chrsmith commented 4 years ago

Pushed a commit to fix the broken unit test. I was able to reproduce the Travis failure locally.

I would have guessed that the way to fix this would be with the following. (Passing a value to the throws function rather than the "constructor-like thing to the Error interface?)

            assert.throws(() => { database.rdsInstanceBackupEnabled("mandatory", 0); },
+                 new Error("Specified retention period must be greater than 0."));
-                 Error("Specified retention period must be greater than 0."));

But that didn't work either. (Not sure why, since from the docs that appears to be supported.) https://nodejs.org/api/assert.html#assert_assert_throws_fn_error_message

So I just changed it to just pass the expected error message. (Which is probably for the best, since verifying that the type of the thrown exception is Error doesn't really add much.)

chrsmith commented 4 years ago

@ekrengel merging so this doesn't become stale with pending SDK changes.