11

I have an existing aws infrastructure with VPC's, subnets, instances,etc. If I need to build the same infrastructure again in future is there any way to create a cloud formation template from the existing infrastructure? Please help.

2 Answers2

10

Check the Github Former project. Former2 can generate not just CloudFormation but Terraform Troposphere templates, and CDK (typescript) from your existing AWS resources

Walid
  • 679
  • 9
  • 15
6

There is stack available in CloudFormation templates named CloudFormer. You can create AWS CloudFormation Templates from Existing AWS Resources by using this stack. Although, as it is in Beta version it might not be supported for all the resources. You can refer document for more information about CloudFormer:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-using-cloudformer.html

Aress Support
  • 1,103
  • 3
  • 11
  • 1
    CloudFormer can be a useful tool, but I think users should simply use it as a kind of reference while they write the real CloudFormation template from scratch. Obviously you should ideally try to avoid getting into a situation in which you want to retroactively create a template for existing infrastructure. – jarmod Oct 25 '19 at 19:51
  • 2
    CloudFormer doesn't seem to be available anymore. Former2 (mentioned in another answer) seems to be a good alternative. I run locally just to be sure I know where my credentials are going. – emorris Oct 23 '20 at 11:07
  • 1
    Just an FYI: CloudFormer is not supported by AWS any more and the link above is dead. – Defiant Apr 06 '21 at 13:22