- Newest
- Most votes
- Most comments
The error you're encountering during the AWS Control Tower unmanage account action is related to the trust relationship configuration between the AWSControlTowerExecution role in the child account and the AWSControlTowerStackSetRole in the management account.
When AWS Control Tower attempts to unmanage an account, it needs to perform stack operations on the AWSControlTowerBP-BASELINE-CONFIG stack set. However, the operation is failing because the AWSControlTowerExecution role in the target account doesn't have the proper trust relationship with the service-role/AWSControlTowerStackSetRole in the management account.
Your troubleshooting steps were on the right track. You identified that the AWSControlTowerExecution role was being deleted during the stack delete operation. This is happening because when you originally deployed the CloudFormation StackSet to create the AWSControlTowerExecution role across your accounts, you used the default "Delete stacks" setting for account removal behavior.
Your solution is correct. By editing the automatic deployment settings of the original StackSet that deployed the AWSControlTowerExecution role and changing the "Account removal behavior" from "Delete stacks" (default) to "Retain stacks," you ensure that the AWSControlTowerExecution role remains in the account even when the account is removed from the StackSet's target accounts. This allows AWS Control Tower to complete its unmanage process successfully.
This approach is particularly important in environments where AWS Control Tower was deployed to an existing AWS Organization with many accounts, as it ensures the proper sequence of operations when managing and unmanaging accounts.
Sources
Troubleshoot AWS Control Tower role error | AWS re:Post
Unenroll an account - AWS Control Tower
That error means Control Tower couldn’t assume the AWSControlTowerExecution role in the target account because the role’s trust relationship doesn’t point to the service-role/AWSControlTowerStackSetRole in the management account. When the role is deployed through a StackSet using service-managed permissions, CloudFormation automatically creates a service-managed execution role for StackSets, not the Control Tower one. As a result, accounts enrolled that way appear to have the right role name but lack the correct principal in the trust policy, causing stack instance operations to fail with “INOPERABLE” status.
—Taz
answered 10 months ago
Relevant content
asked 4 years ago
asked 3 years ago
