terraform-aws-modules / terraform-aws-rds

Terraform module to create AWS RDS resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/rds/aws
Apache License 2.0
883 stars 1.33k forks source link

To restore deleted database from continuous AWS backup plan (PITR) #567

Open grzegorz-kulis opened 1 week ago

grzegorz-kulis commented 1 week ago

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? Yes

Is your request related to a problem? Please describe.

Right now it is not possible to restore a database using continuous AWS Backup plan (PITR) to restore a deleted database. Currently, no argument is able to provide the support for pointing to continuous recovery point with arn such as arn:aws:backup:eu-west-1:***********:recovery-point:continuous:db-**************-**********

Describe the solution you'd like.

I would like to be able to perform PITR for a deleted database pointing to continuous recovery point in such a way:

  restore_to_point_in_time = {
    restore_time                             = "2024-09-25T10:25:00Z"
    source_continuous_automated_backup_arn = "arn:aws:backup:eu-west-1:***********:recovery-point:continuous:db-**************-**********"
  }

Describe alternatives you've considered.

The only alternative so far is building additional tools that would base on AWS CLI aws backup start-restore-job or AWS SDKs which introduces other issues when it comes to tracking the correct Terraform state which would have to be handled separately.

Additional context

I can imagine that most of things in here are based off restore-db-instance-to-point-in-time which allow working with continuous backups while the feature I am describing is basing off start-restore-job which might at this point make things undoable at this point already.

cl0udf0x commented 1 day ago

@grzegorz-kulis This issue was resolved in version 4.3.0.

https://github.com/terraform-aws-modules/terraform-aws-rds/blob/master/modules/db_instance/main.tf#L114