mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
* fix(rds): store and return the encryption and backup settings given on create DescribeDBInstances never returned StorageEncrypted, KmsKeyId, BackupRetentionPeriod or CopyTagsToSnapshot, and wrote both windows as constants. Store the six values from CreateDBInstance, apply the backup settings and windows from ModifyDBInstance, and emit them from the instance XML. A record persisted without them reads as AWS defaults. KmsKeyId is resolved against the KMS store in the request's region — a key ARN, key id, alias ARN or alias name — and stored as the key ARN, as a live account reports it; a key that does not exist or is not enabled is KMSKeyNotAccessibleFault. Validation follows a live account: KmsKeyId needs StorageEncrypted, window times are checked with AWS's wording, windows are at least 30 minutes and may not overlap; the retention period is not range-checked since AWS accepted 40 days. Closes #2611 * fix(rds): check window overlap against the windows that will be in effect A window given alone was not checked at all: the request's other window was null, so validate() skipped the overlap check although the instance kept its stored counterpart on modify and got a default on create. Check the pair that results from the request — on modify the stored other window, on create the default, swapped for an alternate default when the given window overlaps it, since AWS picks a random window clear of the given one. Verified on a live account: a modify overlapping the stored window is refused either way, replacing both at once checks only the new pair. * fix(rds): detect window overlap across the week boundary in both directions A Sunday backup window running past midnight lies beyond the end of the week, so comparing it with a Monday maintenance window needs the maintenance interval shifted forward as well as back. * fix(rds): derive the default counterpart window from the given one's end A fixed alternate default cannot be clear of every window a request can give — a 00:00-07:00 backup window covers it. When the window given on create overlaps the usual default, pair it with a 30-minute window that starts the minute the given one ends, which is clear of a daily window by construction; the overlap check stays as the backstop. * fix(rds): refuse a window given alone that leaves no room for the other, in AWS's words The derived counterpart is clear of any window that leaves a 30-minute gap (swept over every start and length in DbInstanceSettingsTest); a window longer than that has no clear counterpart, and a live account refuses it: "The specified backup window overlaps all available default maintenance windows. Shrink the backup window or specify a non-overlapping maintenance window." (mirrored for maintenance), and a maintenance window of 24 hours or more is "Maintenance window must be less than 24 hours." * refactor(rds): share the window checks with BackupWindows