aws-deployment-framework
aws-deployment-framework copied to clipboard
Feature createorganizationalunit
Why?
In our existing Account Creation workflow, we are required to create new organizational units via the Organizations console in our master account. This requires us to sign in to our master account with heightened priveleges for every new account (that has a new path)
We run a multi account strategy so this happens reasonably often.
We'd prefer for this to be automated. This change will programmatically create any new Organizational Units if a new path is defined in the adf-accounts
configuration.
Response to Issue: (https://github.com/awslabs/aws-deployment-framework/issues/263)
What?
Description of changes:
- Updated permissions on
adf-codebuild-role
in master account - Added a new method
Organizations.create_ou()
- Refactored existing method
Organizations.get_ou_id()
-
- refactor
while
loop tofor
loop
- refactor
-
- refactor logic in for/else to create OU if not found as defined by the path
- stubbed tests for both methods
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.