- Newest
- Most votes
- Most comments
There is no built-in way to accomplish this task. When using AWS services, you might change your account configuration and/or create various resources like IAM roles or CloudWatch log groups. Additionally, you might change global or regional service configurations (e.g. for AWS Config or Amazon API Gateway). Further more, while using the services, your account's internal metrics will change. So basically, there is no way to do a 'factory reset' of an AWS account.
Even when you deploy your resources using the IaC approach (AWS CloudFormation or AWS CDK) and then delete the stacks, you still might have some data or configuration that differs from defaults (e.g. CloudWatch metrics - you cannot delete them, they expire automatically).
The only way to fully reset everything is to delete your existing account and create a new one.
Open-source tools may serve your purpose.
amazon web services - Factory reset AWS account - Stack Overflow
However, please use it at your own risk.
Warning: these open source tools are not provided by AWS, you should take every precaution to ensure that nothing critical gets deleted, and you are responsible for your choices and actions.
Relevant content
- asked a year ago
- Accepted Answerasked 8 months ago
- asked 8 months ago
- Accepted Answerasked 7 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
Thank you for your answer. However, this is exactly what I do NOT want to do. I do not want something that traverses the account and deletes things. I have seen this answer before. It does not answer the question but only provides a hack.
I want to know if there is a way to actually do a real reset, that removes everything then ensures the default objects are recreated. Neither AWS-Nuke nor Cloud-Nuke do this. They just destroy everything without recreating the default objects (VPC, subnets, etc.).
So, back to my original question: is there a way to do a factory-type reset of an AWS account?
This is the only option and does almost exactly what you want. The only Default configuration you would need to worry about in the account after the
nuke
IS the launch of a "Default" VPC which I would never use for anything other than tinkering, and you can create a new Default VPC right from the VPC Console. Or if you are looking for a way to automate this, you can just add the CLI to create it at the end of your automaiton. Found here: https://docs.aws.amazon.com/cli/latest/reference/ec2/create-default-vpc.html