Best practice for restoring an RDS Aurora snapshot into a CloudFormation-built solution

0

Hi experts,

I'm looking for best practices in restoring data into a cloudformation-built system.

I've got extensive cloudformation that builds a solution, including an RDS Aurora Serverless database cluster. Now I want to restore that RDS server from a snapshot.

For the DbSnapshotIdentifier point above, here's the relevant wording from their docs that concerns me:

After you restore a DB instance with a DBSnapshotIdentifier property, you must specify the same DBSnapshotIdentifier property for any future updates to the DB instance. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the DBSnapshotIdentifier property, an empty DB instance is created, and the original DB instance is deleted

It seems this should be simple but it's not. Please don't tell me I need to fall back to using mysqlbackup ¯\_(ツ)_/¯

Thanks in advance, Scott

scott
질문됨 2년 전1328회 조회
1개 답변
0

Hi Scott - The DbSnapshotIdentifier property is a "Replacement" property so whenever it is updated a new instance is created and previous instance destroyed. I'll walk through a brief scenario to hopefully explain.

  1. Create a cluster in a new stack without DbSnapshotIdentifier property - this will be a blank DB
  2. Update the stack with DbSnapshotIdentifier to restore from a snapshot - this will build a new db from the snapshot and destroy the previous instance
  3. Update the stack again with some other property keeping the previous DbSnapshotIdentifier value the same - no restore will be attempted as the DbSnapshotIdentifier property has not changed. It will not revert to the snapshot specified previously
  4. Update the stack again with a new DbSnapshotIdentifier property - this will build a new db from the new snapshot and destroy the previous instance

If you remove the DbSnapshotIdentifier property from the stack it will see that as a change and therefore build a new blank instance and destroy the previous. Therefore once you use the property once you need to keep using with either the old value to do nothing or a new value for a new restore

AWS
전문가
Peter_G
답변함 2년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠