Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add restore_to_point_in_time support for databases #338

Merged
merged 6 commits into from
Jun 28, 2021
Merged

feat: Add restore_to_point_in_time support for databases #338

merged 6 commits into from
Jun 28, 2021

Conversation

luedigernet
Copy link
Contributor

Description

This adds restore_to_point_in_time support for databases others than mysql.

Motivation and Context

When you have to perform a point in time recovery on a AWS RDS Instance it will always create a new instance.
In order to get this new instance under control of terraform I would use the same terraform-aws-module that was used to create the source database. The existing module is using the aws_db_instance resource of the aws provider. Because this resource supports already the restore_to+point_in_time Input this module should support it as well.

Breaking Changes

No braking changes.

How Has This Been Tested?

We tested it with the following steps

  • creating an AWS RDS instance with this module
  • creating a table and inserted some data with actual timestamp of inserting.
  • waiting until the AWS console reported a latest available timestamp for recovery after our inserted data
  • created a new instance with the restore_to_point_in_time option using the identifier of the source database and a timestamp in the middle of 2 inserted rows in the source database
  • checking after finished instance creation that the data up to the provided timestamp exists and the data behind it does not exist.

…mysql

Add restore_to_point_in_time support for databases others than mysql

Signed-off-by: Reinhard Luediger <reinhardluediger@gmail.com>
restore_time = restore_to_point_in_time.value.restore_time
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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo here - we have use_latest_restorable+time but should be use_latest_restorable_time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@khdevel
Copy link

khdevel commented Jun 24, 2021

How do you see this implementation? When will it be available in standard release? @antonbabenko

@antonbabenko antonbabenko changed the title feat: add restore_to_point_in_time support for Databases others than … feat: Add restore_to_point_in_time support for databases Jun 28, 2021
@antonbabenko antonbabenko merged commit 1e05556 into terraform-aws-modules:master Jun 28, 2021
@antonbabenko
Copy link
Member

v3.2.0 has been just released.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants