Skip to content

Add support for restoration of Automated Backups (just one line change) #397

@jonasneves

Description

@jonasneves

This parameter was added to the AWS provider in this PR and merged to the main branch on March 15:
hashicorp/terraform-provider-aws#23086

For this to work with the module terraform-aws-modules/terraform-aws-rds, the parameter "source_db_instance_automated_backups_arn" needs to be added to the dynamic block restore_to_point_in_time, like in the example below.

terraform-aws-rds/modules/db_instance/main.tf

  dynamic "restore_to_point_in_time" {
    for_each = var.restore_to_point_in_time != null ? [var.restore_to_point_in_time] : []

    content {
      restore_time                             = lookup(restore_to_point_in_time.value, "restore_time", null)
      source_db_instance_automated_backups_arn = lookup(restore_to_point_in_time.value, "source_db_instance_automated_backups_arn", null)
      source_db_instance_identifier            = lookup(restore_to_point_in_time.value, "source_db_instance_identifier", null)
      source_dbi_resource_id                   = lookup(restore_to_point_in_time.value, "source_dbi_resource_id", null)
      use_latest_restorable_time               = lookup(restore_to_point_in_time.value, "use_latest_restorable_time", null)
    }
  }

This will hugely simplify restoration of backups based on Automated Backups, right now I've been using an external script for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions