Contents

How to: delete AWS Organization accounts

As a best practice AWS accounts that are unused or surplus to requirement should be deleted. Unfortunately the process to do so was both manual and time consuming. That all changed on the 29th of March 2022 when AWS announced the availability of the ‘CloseAccount’ API.

In this post I’ll be providing a quick overview of how to close or delete AWS accounts that are members of an AWS Organization.

1.0 Introduction

On the 22nd of March 2022 AWS announced the general availability of the ‘CloseAccount’ API.

This made it possible to close AWS Organization member accounts in one the following three ways:

  • Via the web-based AWS Administration Console
  • With AWS CLI Tools
  • Programmatically via the AWS SDK

2.0 Closing an Account

2.1 AWS Console

Browse to AWS Organizations within the AWS console.

/aws-organization-delete-account/aws-org-accdel-1.png

Click on the organization that you wish to close.

/aws-organization-delete-account/aws-org-accdel-2.png

Select close in the top right-hand corner.

/aws-organization-delete-account/aws-org-accdel-3.png

Manually type, or copy & paste, the organisation number, and then click Close account.

/aws-organization-delete-account/aws-org-accdel-4.png

That’s it! The account is now closed.

2.2 AWS CLI Tools

Accounts can be closed via PowerShell and Command Prompt on Windows, or the Terminal on Linux and Mac OS.

Make sure you have the latest AWS CLI Tools installed and have connected to your AWS Organization management account. This is the account that manages your AWS Organization and has the ‘management account’ label within the web-based AWS console.

More information on installing and configuring the AWS CLI Tools is available here.

Open your preferred CLI app and run the following command:

1
aws organizations close-account --account-id ACCOUNT_ID_HERE

4.0 Summary

That’s it!

The above steps will close an AWS Organization member account. There is a grace period of 60 days where it’s possible to recover the deleted account by contacting AWS support. After the grace period, you’ll be out of luck.

Comments