How to create a cloud formation template from an existing AWS environment?
Asked Answered
F

2

30

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.

Fabrin answered 28/3, 2019 at 6:29 Comment(1)
Possible duplicate of Export AWS configuration as CloudFormation templateMccahill
G
4

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

Gilboa answered 28/3, 2019 at 6:37 Comment(3)
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.Endora
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.Scenery
Just an FYI: CloudFormer is not supported by AWS any more and the link above is dead.Lanoralanose
M
18

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

Mindoro answered 25/10, 2019 at 19:27 Comment(0)
G
4

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

Gilboa answered 28/3, 2019 at 6:37 Comment(3)
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.Endora
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.Scenery
Just an FYI: CloudFormer is not supported by AWS any more and the link above is dead.Lanoralanose

© 2022 - 2024 — McMap. All rights reserved.