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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则