Disabling AWS RDS backups when creating / updating instances?

I create new instances of MySQL RDS from snapshots and update their configurations both through the API and through the interface. Regardless of how I create or update instances, these actions automatically trigger new snapshots that must be created using some kind of automatic backup process. Is there a way to turn off snapshot creation when performing these steps, since I do not need additional snapshots, and creating them causes an unnecessary delay?

+5
source share
1 answer

I spoke with AWS support, and it seems that it is impossible to prevent the creation of the backup when creating the instance. This is due to how the backup is created when creating / updating (this is part of the automatic backup process) and the ability to manage this function is limited (turn it on and off, but only for existing instances).

Here are a few more details if anyone else is facing the same problems as me.

I am interested in two scenarios:

  • Do not back up in RestoreDBInstanceFromDBSnapshot request
  • Do not back up in ModifyDBInstance request

Backups are managed by this flag:

BackupRetentionPeriod = 0 

Unfortunately, this flag is part of the instance and snapshot, but can only be set on the instance. Therefore, in order to create an instance with this set of flags (and therefore not a reserve), the snapshot would have to disable this flag. This can only happen if the source instance has disabled this flag. At this stage, we could consider switching the flag to the original instance when shooting, however disabling and re-enabling this flag has negative side effects, including:

 There is a way to disable automatic backups for existing instances however we highly discourage against this because it disables point-in-time recovery. Once disabled, re-enabling them will only restore the backups starting from the time you re-enable automatic backups. 

We will lose all existing backups of the original instance. The end result is that there is no effective way to avoid creating the first backup when creating an instance from a snapshot.

When updating an existing instance, it’s better to receive news, since we can disable backups as part of the ModifyDBInstance request:

 https://rds.amazonaws.com/ ?Action=ModifyDBInstance &DBInstanceIdentifier=mydbinstance &BackupRetentionPeriod=0 

Of course, it still suffers from losing backups; however, my initial goal was to be able to create and modify snapshots of production databases, use them for a short period of time (hours), and then discard them. Avoiding external backups reduces the overhead in this process.

Hope this information is useful to someone else!

+11
source

Source: https://habr.com/ru/post/1244148/


All Articles