How to convert AWS resources to a cloudformation stack or template?
Asked Answered
B

4

8

I have a bunch of AWS resources (ec2 instances, rds, s3, etc.)

Those resources were created manually over the years in AWS console.

Now I would like to duplicate this environment using CloudFormation. What is the best approach? Is there a tool, that converts all the resources into a cloudformation stack or template?

I couldn't find anything, or maybe I didn't understand the process correctly...

Birgit answered 3/2, 2021 at 14:47 Comment(1)
this thread migh be of usePhotoemission
J
5

These days you would use a third party, free and fully open-source tool called former2 developed by renovated AWS Hero. The former2 is used by corporate clients of AWS as explained in the AWS blog post.

Jot answered 4/2, 2021 at 0:17 Comment(0)
C
1

You could potentially try the AWS Console Recorder extension for Chrome/Firefox which supposedly could create CloudFormation templates based on your AWS Console clicks.

From their README:

Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.

Caveat: Not all resources are supported.

Cuda answered 3/2, 2021 at 15:5 Comment(0)
F
0

There was a service named CloudFormer that could perform this action but has since become deprecated.

Functionality does exist within CloudFormation to create a stack from existing resources.

However, to use this you will want to design the stack to use the same options and setup as your resources. Once this is completed you could then manage these resources via CloudFormation.

More information is available in the Import Existing Resources into a CloudFormation Stack blog post.

Felafel answered 3/2, 2021 at 14:50 Comment(4)
But I don't understand, In those links I first need a cloudformation template that describes the existing resources. But that's exactly what I don't have.... What am I missing?Birgit
Unfortunately thats the only option that is now supported within CloudFormation. You would indeed have to create the templates yourself, but at least once you've created them the resources can be managed via this method.Felafel
The way CloudFormer works is that you launch a stack from a provided CoudFormer template. That creates an EC2 instance that you will use to interrogate the remainder of your account. Once you launch the CloudFormer stack, you then visit the CloudFormer EC2 instance web page and provide it with information about which resources in your AWS account you want CloudFormer to describe in the output CF template that it generates.Curb
I think Former2 is the successor to CloudFormer (I've never tried it to see how well it works though) - former2.comLawn
O
0

You can use IaC Generator that scans your account to find existing resources. Then it generates cloudformation templates for managing those resources. Here are the step by step on how you can proceed.

  • Go to CloudFormation
  • Select IaC generator
  • Scan resources
  • Create template choosing which resources you want.

Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html

Ophthalmitis answered 12/8 at 2:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.