Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create CloudFormation Yaml from existing RDS DB instance (Aurora PostgreSQL)

I have an RDS DB instance (Aurora PostgreSQL) setup in my AWS account. This was created manually using AWS Console. I now want to create CloudFormation template Yaml for that DB, which I can use to create the DB later if needed. That will also help me replicate the DB in another environment. I would also use that as part of my Infrastructure automation.

like image 982
Learner Avatar asked Jun 05 '20 00:06

Learner


2 Answers

Unfortunately, there is no such functionality provided by AWS.

However, you mean hear about two options that people could wrongfully recommend.

CloudFormer

CloudFormer is a template creation beta tool that creates an AWS CloudFormation template from existing AWS resources in your account. You select any supported AWS resources that are running in your account, and CloudFormer creates a template in an Amazon S3 bucket.

Although it sounds good, the tool is no longer maintained and its not reliable (for years in beta).

Importing Existing Resources Into a Stack

Often people mistakenly think that this "generates yaml" for you from existing resources. The truth is that it does not generate template files for you. You have to write your own template which matches your resource exactly, before you can import any resource under control to CloudFormation stack.

Your only options is to manually write the template for the RDS and import it, or look for an external tools that could reverse-engineer yaml templates from existing resources.

like image 56
Marcin Avatar answered Sep 19 '22 16:09

Marcin


You can use former2 to generate CloudFormation templates (json and yaml) of your existing infrastructure. Free to use. https://github.com/iann0036/former2

like image 40
Raman Damodar Shahdadpuri Avatar answered Sep 22 '22 16:09

Raman Damodar Shahdadpuri