-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bootstrapping accounts in non-protected OUs only (#590)
**Why?** While running the `adf-build/main.py` script: 1. It would get the list of accounts of this specific AWS Organization. 2. Spin up a thread for any of the non-deployment accounts. 3. In the thread, check if the account is in the root or in a protected OU. If so, it would stop the thread. If not, it would deploy the bootstrap templates. So far so good. 4. When invoking the Step Function to enable the cross-account access, it would use the list of account ids it retrieved before. However, this list is unfiltered. Therefore, the Step Function State Machine would try to enable the cross account access on accounts that were in the root and/or in protected organization units. **What?** We would only need to bootstrap accounts that are: * Active, * Not in the AWS Organization root, and * Not in an AWS Organization OU that is listed as protected. ADF should also fix the cross-account access in those accounts only. As the others don't have a bootstrap template deployed that needs to be updated any way. Thus, instead of introducing the same logic in the Step Function. This change set moved the responsibility for filtering the accounts based on their state and location in the Organizations class. Tests were added to validate that this works correctly. Additionally, fixes were introduced to reduce the line lengths where needed.
- Loading branch information
Showing
4 changed files
with
419 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.