How to import existing Aurora PostgreSQL into terraform

0

Hi, I have some RDS but i want to import them into terraform, so they can be easier to manage, i saw that there is an import command but I'm not sure if using this will be the best approach because if i understood correctly it may also delete services, what would be the best way to migrate an existing Aurora PostgreSQL to terraform? and a short example or some articles that would help would be nice :)

2 Answers
0

Hello.

When you want to manage existing AWS resources like an RDS instance with Terraform, the terraform import command is indeed the way to go.https://developer.hashicorp.com/terraform/cli/import

Regards, Andrii

profile picture
EXPERT
answered 7 months ago
0
  1. Firstly you need to build your Terraform code to match the configuration of the RDS instances.
  2. Secondly, you would then need to import each RDS into your Terraform state using the import command.
  3. Thirdly, you should run a terrform plan to align and see any differences between the State and the .tf files.

Using the Plan ensures that when you run an apply you will not see any unexpected changes such as a destroy.

profile picture
EXPERT
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions