Closed caroseuk closed 3 years ago
Hi,
To troubleshoot the specific failure, we need the CloudWatch log from the Codebuild session (State Machine Phase) that failed. In that log, specifically if you search for the first (not last) occurrence of UPPERCASE "FAIL" - it normally leads to the exact cause of failure.
If I was to GUESS, you removed the users and policies at the same time. CloudFormation, which CDK synthesizes too, is not smart enough to reverse order of operations for remove versus create, so it is likely trying to delete the policy before the user that uses it has been removed, which is blocking the operation. (i.e. remove the users, run the SM, then remove the policy, run the SM, and may resolve your problem).
To simplify your config file, once complete you can drop to using the following with the same outcome:
"management": {
"account-name": "Test ASEA",
"__LOAD": "global/primary-email.json",
"ou": "Core",
"src-filename": "config.json",
"budget": {
"__LOAD": "global/budgets.json"
},
"s3-retention": 180,
},
Bug reports which fail to provide the required information will be closed without action.
Required Basic Info
Describe the bug When editing the config.json file and within the "management" account configuration, removing users from the iam block, the state machine fails. It appears that you must have a user being created for the state machine to succeed.
From looking at the code at the following location, it states that the iam object is optional, but even removing that completely from my config.json file it still fails.: https://github.com/aws-samples/aws-secure-environment-accelerator/blob/4b4bd995417560a552af43d888f28ad13c024716/src/lib/common-config/src/index.ts#L578
In the meantime I have had to pass in a user to be created for the step function to succeed.
Failure Info
Required files
Steps To Reproduce
config.json
locate the mandatory-account-configs > management block.Expected behavior Any users created using ASEA would now be removed from the master account