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 Risposte
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
ESPERTO
con risposta 7 mesi fa
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
ESPERTO
con risposta 7 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande