How to manage a restored db_instance?

I can create a DB by restoring a snapshot created from another DB, via Terraform or Web Console.

Via Web Console, after the restoring action, the DB is just there, no strong binding with the snapshot it came from.

But via Terraform, say for following code. After I restored the DB and removed the snapshot, how do manage the DB based on this code? I tried removing the “data” part, and “snapshot_identifier” attribute. But then Terraform wanted to replace the resource because I specified “identifier_prefix”.

Is there a general routine for this?

data "aws_db_snapshot" "latest" {
  db_instance_identifier = aws_db_instance.db.id
  most_recent            = true
}

resource "aws_db_instance" "db-new" {
  identifier_prefix           = "db-"
  instance_class              = "db.t2.micro"
  snapshot_identifier         = data.aws_db_snapshot.latest.id
# Some attrs skipped
}