Terraform - AWS RDS Global Database restore

I have a question regarding restoring a global aurora postgresql database.

During my test, I was able to restore my global rds database by adding a data block to query latest snapshot and using snapshot_id in my resources to restore that specific snapshot.

Once the restore completed, I was assuming I would simply remove the snapshot_id to avoid, next time TF apply, restoring the cluster with the newest snapshot.

After updating snapshot_id to null and running tf plan, the plan indicated that it would delete the restored cluster and recreate fresh.

How should I approach restoring a global rds cluster with terraform ?


After some analysis, the issue was not by changing snapshot_id to null but the way our internal AWS RDS is coded.

The resources name are different if we perform restore or not.
I just needed to add some moved {} after changing snapshot_id to null to fix terraform plan.