{"id":6144,"date":"2023-08-18T08:00:00","date_gmt":"2023-08-18T06:00:00","guid":{"rendered":"https:\/\/blog.besharp.it\/?p=6144"},"modified":"2023-09-01T17:30:31","modified_gmt":"2023-09-01T15:30:31","slug":"clean-up-multiple-aws-accounts-automatic-resources-deletion-with-iot-button","status":"publish","type":"post","link":"https:\/\/blog.besharp.it\/clean-up-multiple-aws-accounts-automatic-resources-deletion-with-iot-button\/","title":{"rendered":"Clean up multiple AWS accounts: automatic resources deletion (with IoT button)"},"content":{"rendered":"\n

More and more companies are choosing the Landing Zone approach<\/strong> to their AWS Accounts management. As a result, our work sometimes requires us to work on dozens or, less often, hundreds of AWS accounts simultaneously for a single project. <\/p>\n\n\n\n

Not sure what a Landing Zone is? Check out <\/em>our series<\/em><\/a> on it!<\/em><\/p>\n\n\n\n

The most recent example was creating a testing environment in our accounts where we had to perform test deployments before deploying to the customer organization. The organization’s size justified this need: almost 400 AWS accounts<\/strong>, so we could not make any mistakes. To mimic their environment, we created an ad-hoc AWS Organization with a dozen accounts with carefully selected resources deployed.<\/p>\n\n\n\n

After the work was done, we had to close those accounts, but closing multiple AWS accounts full of resources<\/strong> can be time-consuming. Of course, it must be automated as much as possible!<\/p>\n\n\n\n

Closing an AWS Account<\/h2>\n\n\n\n

Closing an account may appear as easy as pressing the “Close” button, but this action has a variety of caveats. Some depend on the account being a standalone<\/strong> account or a member of an AWS Organization<\/strong>; others are common for both account types.<\/p>\n\n\n\n

Here is a little cheat sheet of the most important points of attention:<\/p>\n\n\n\n