PaloAltoNetworks / pcs-sizing-scripts

Prisma Cloud sizing scripts
ISC License
46 stars 49 forks source link

optionally process AWS Organization (member) accounts #2

Closed tkishel closed 3 years ago

tkishel commented 3 years ago

Description

Accept an org parameter to size AWS Member Accounts attached to an AWS Organization. Based upon code written by Adam Clark. Also, corrects an error resetting IFS

Motivation and Context

How Has This Been Tested?

Original functionality tested.

AWS Organization untested (I have no access to one)

Types of changes

Checklist

tkishel commented 3 years ago

FWIW: I cannot set a "Do Not Merge" (until tested) label 🤷🏻‍♂️

tkishel commented 3 years ago
~ shellspec spec/aws_resource-count-aws.sh

Running: /bin/sh [bash 3.2.57(1)-release]
............

Finished in 4.45 seconds (user 3.84 seconds, sys 0.70 seconds)
12 examples, 0 failures
tkishel commented 3 years ago

Testing: I've added spec tests, covering each function in the script (and refactored the script to use functions: for all but parsing the one optional org parameter, and the jq check) ... including all of the aws commands. For the mocking of those commands, I used the example output from the AWS CLI documentation for each command.

Documentation: I don't have the source of the PDF to update it, but the optional org parameter is documented via a comment.