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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南