From 05d42cafd12a1af42d9a698e7fba0a00c4184736 Mon Sep 17 00:00:00 2001 From: Dave Hall Date: Thu, 25 May 2023 00:54:01 +1000 Subject: [PATCH] Allow shorter db names fixes #9 --- functions/export-to-s3/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/export-to-s3/index.py b/functions/export-to-s3/index.py index 7cd2dd3..6c2b136 100644 --- a/functions/export-to-s3/index.py +++ b/functions/export-to-s3/index.py @@ -37,8 +37,8 @@ def handler(event, context): matchSnapshotRegEx = "^rds:" + db + "-\d{4}-\d{2}-\d{2}-\d{2}-\d{2}$" if re.match(matchSnapshotRegEx, sourceId): exportTaskId = ((sourceId[4:] + '-').replace("--", "-") + messageId)[:60] - if exportTaskId[59] == "-": - exportTaskId = exportTaskId[:59] + if exportTaskId[-1] == "-": + exportTaskId = exportTaskId[:-1] response = boto3.client("rds").start_export_task( ExportTaskIdentifier=exportTaskId, SourceArn=sourceArn,