Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally process AWS Organization (member) accounts #2

Merged
merged 2 commits into from
Dec 29, 2020
Merged

optionally process AWS Organization (member) accounts #2

merged 2 commits into from
Dec 29, 2020

Conversation

tkishel
Copy link
Contributor

@tkishel tkishel commented Dec 16, 2020

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

  • Target Company has many AWS accounts, where executing a script against individual single accounts may be impossible or an unreasonable task.
  • Target Company is using the AWS Organizations functionality, and has provisioned their AWS accounts as member accounts within that organization.

How Has This Been Tested?

Original functionality tested.

AWS Organization untested (I have no access to one)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@tkishel
Copy link
Contributor Author

tkishel commented Dec 16, 2020

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

@ebeuerle ebeuerle self-requested a review December 28, 2020 22:22
@tkishel
Copy link
Contributor Author

tkishel commented Dec 29, 2020

~ 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
Copy link
Contributor Author

tkishel commented Dec 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants