mozilla / frost

Unit testing framework for test driven security of AWS, GCP, Heroku and more.
https://mozilla.github.io/frost/
Mozilla Public License 2.0
104 stars 24 forks source link

Refactor AWS resource calls into classes #418

Open ajvb opened 3 years ago

ajvb commented 3 years ago

_from this discussion: https://github.com/mozilla/frost/pull/417#discussion_r524492537_

Currently, there is some brittleness around how our AWS resource calls and the id extraction are separated from each other.

This is currently leading to vague and brittle get_resource_id() functions that parameterize uses to get the test id.

Along side this, there are what amount to hacks for dealing with "resources" that are lists or do not exist (i.e. https://github.com/mozilla/frost/pull/417/files#diff-ee242f021608b58d502ee9c4c6273c6145f18e6703f8329b3799c50db5c8fe95R155)

As a result, it seems like it may make sense to transform the resources.py functions into classes (dataclasses, boto3 classes, etc).