Reputation: 15974
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...
Upvotes: 8
Views: 5253
Reputation: 394
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.
Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html
Upvotes: 1
Reputation: 238081
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.
Upvotes: 5
Reputation: 1273
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.
Upvotes: 1
Reputation: 35146
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.
Upvotes: 0