Ok I’ve been circling around this question for a bit now. Is there an easy way to do this or is it layered?
I understand that: Cloudformation helps set up new, AMIs are resource specific backups, Config keeps metadata/changes (also kind of wondering if I can reproduce anything from Config)
But wondering if there is a easy way to just backup my entire VPC if something happens and I need to reproduce it. Things like SGs, RTs, VPN connections and such…
Thanks!
Related discussions:
You can try cloud former which is a way to reverse engineer cloud formation.
Also you can try using import calls into something like terraform?
Trying to reverse engineer from a custom setup that’s not driven by code is always going to be fraught with peril (just a little peril!). While CloudFormer and the import functions of Terraform can help, they’re means to an end of having your infrastructure being created/maintained/documented via code and not means of performing snapshots for manually maintained environments.
Your problem is encountered by pretty much everyone at the beginning of their organization’s cloud adoption. I’d suggest creating a new account and manage it through cloudformation, and then either let the stuff in your current account die over time or migrate it to your new account. Welcome to infrastructure as code 
Trying to mix “infrastructure by click” and “infrastructure as code” will surely not end up well. Build a good software development pipeline and manage your infrastructure through that pipeline.
Hashicorp has your back here, packer and terraform
I’ve done a ton of account takeovers and have used a ton of tools to try to turn manually-built infrastructure back into code. What I’ve had the most luck doing is to build, with code, the same infrastructure side-by-side with the VPC(s) or account(s) I’m taking over. Then, cut over to the new version you built via DNS change (with the fall-back plan just being to cut DNS back.)
Then, when you’re completely confident in your new env, with all the best practices baked in, you tear down the old resources and now you have this new one that code built.
A Jenkins job or a lambda function can automatically snap your instances, your chef recipes or whatever can all be built to also drop a cron job to move app state to s3.. lots of things can be backed up automatically.
- Config doesn’t let you reproduce anything from Config, but it does allow you to run a Lambda function whenever a Config rule is matched (or executed, I can’t remember what they call it).
- For your actual question, might I suggest something different? The others have already suggested starting over, and I agree - but as far as your disaster recovery plan for your VPC, its probably adequate to just go down the list of EC2 APIs (that’s where the VPC stuff is stored), and call all the APIs starting with “Describe”.
There’s quite a few of them, but it could be scripted. Then just save the output of each command as a file, and zip the files up - there you go! You can’t automatically recreate everything, but you do have an audit log of all your infrastructure, and the way the APIs work, you CAN import the JSON that is outputted back in to the APIs, and with a little fiddling with the JSON, would be able to recreate everything. Of course, you can also just use it as a reference and re-create things with CloudFormation, but you don’t have to worry about forgetting any of your setup!
Are containers backed up in the cloud automatically