Increase the unit test coverage of inventory/aws_ec2.py, and reduce the complexity of the plugin to enable better testing.
Refactor the module as-needed to reduce complexity and enable unit testing of the code.
Create new unit tests for code paths, data structures, success scenarios, and failure scenarios in the code.