Reset All AWS Infrastructure to Defaults

0

Good afternoon.

I am using my AWS account to learn AWS. During this process things have been created and destroyed. How can I get everything reset to where it was before I started, like it was a brand-new AWS account? I am able to find information on password resets, but nothing on resetting the AWS account infrastructure to defaults (factory reset all AWS infrastructure in an account).

Thanks in advance.

2 回答
2

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.

profile pictureAWS
已回答 1 年前
1

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.

profile picture
已回答 1 年前
  • 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

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

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

回答问题的准则