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 個答案
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
專家
已回答 7 個月前
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
專家
已回答 7 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南