-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Support for RestoreDBInstanceFromDBSnapshot AWS API from terraform #5228
Comments
Hi @psura 👋 Are you looking for the
Under the hood this is calling As for your second part, Aurora cluster point in time restores are a completely different feature and we may have reservations about implementing them due to the ephemeral nature of making those types of requests. Please let us know if this helps, thanks! |
Hi @bflad thanks for your response. Yes I am providing the snapshot_identifier. But I am trying to avoid other details like instance_class. This will keep the restore flow quick and easy and I don't have to capture all these details in the state file for the source rds instances (which is what I am doing now as a workaround. Haven't tested it fully though).
And when I make use of aws_db_instance resource I need to provide instance class and other details.
Even if I use module db resource using terraform-aws-modules I will have to provide all these details. When I see the rds restore flow on aws console I see below call that seems to be getting all the required information using the name of the instance and passing it to the new instance being created: Example Console Page: https://console.aws.amazon.com/rds/home?region=us-east-1#db-snapshots: Here is the payload request as you see by inspecting the network calls from chrome browser The response to above call has all the required parameters including instance class which are being passed/ auto-filled in the restore screen on aws console. Example Response: How can I simulate this with terraform?
Coming to point-in-time-restore support, even AWS RDS has that support not just AWS Aurora. Did not understand what you meant by "ephemeral nature". Can you share more details on why this is not a good candidate for supporting using terraform? |
point-in-time-recovery for Aurora is a consistent solution for a cluster to be recovered during a rollback event. The requestor is correct that "for aurora there are no transaction logs and restore time should be more predictable and faster as backups are incremental in nature." |
And the new Aurora clone feature that uses copy on write is cleaner and faster. And the feature is so old I’m surprised it’s not already supported. https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBClusterToPointInTime.html RestoreType as |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
Use case here is to restore aws rds from a snapshot. I would like is to just provide snapshot id and let aws figure out other details of the source instance from the snapshot and deploy a new rds instance.
I would like to make use of below AWS API through terraform
https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromDBSnapshot.html
As far as I can tell terraform does not support this API directly.
Today looks like I can do this by passing the snapshot id and making use of aws_db_instance resource (https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/data_source_aws_db_instance.go) which corresponds to https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html
Correct me if I am wrong. Just getting hang on terraform api support and its mapping with aws api's.
I did not also see any examples that show aws rds restore from snapshot support without providing instance class and other details.
New or Affected Resource(s)
This looks like a new resource to me but I could be wrong. May be aws_db_instance can be updated to support the RestoreDBInstanceFromDBSnapshot AWS API?
Eventually I am also looking for support of Point in Time Restore from Terraform https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBClusterToPointInTime.html
References
Only issue I found was this one that makes use of aws_db_instance resource
#473
The text was updated successfully, but these errors were encountered: