Scripted Removal of AWS Control Tower Managed Accounts

0

I can use the AWS Control Tower account factory API to provision new managed AWS accounts. I also need to be able to delete AWS accounts with code when they are no longer required. Is there a solution for bulk deleting Control Tower managed AWS accounts without having to log in to each account as the root user and close it?

1 回答
1
已接受的回答

Yes you can do this. If you do not unmanage the account before you close it, you must delete the account's provisioned product in AWS Service Catalog after those 90 days are finished.

From https://docs.aws.amazon.com/controltower/latest/userguide/delete-account.html

You can close your AWS Control Tower member accounts from your organization’s management account without a requirement to sign in to each member account individually with root credentials, by means of AWS Organizations. You cannot close your management account in this way, however.

When you call the AWS Organizations CloseAccount API, or close an account in the AWS Organizations console, the member account is isolated for 90 days, as any AWS account would be. The account shows a Suspended status in AWS Control Tower and AWS Organizations. If you attempt to work with the account during that 90 days, AWS Control Tower gives an error message.

Please see the CloseAccount API Reference here

https://docs.aws.amazon.com/organizations/latest/APIReference/API_CloseAccount.html

profile pictureAWS
专家
Matt-B
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则