From e2f7a1500dcd66d2b534ff8e38f47edc3f3ac99d Mon Sep 17 00:00:00 2001 From: kbalk <7536198+kbalk@users.noreply.github.com> Date: Fri, 22 Oct 2021 10:48:46 -0400 Subject: [PATCH] Firehose timestamps need a timezone or a 'Z' at the end (#4459) --- moto/firehose/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moto/firehose/models.py b/moto/firehose/models.py index 6212dff89..d30bb3926 100644 --- a/moto/firehose/models.py +++ b/moto/firehose/models.py @@ -16,7 +16,7 @@ Incomplete list of unfinished items: - put_record(), put_record_batch() always set "Encrypted" to False. """ from base64 import b64decode, b64encode -from datetime import datetime +from datetime import datetime, timezone from gzip import GzipFile import io import json @@ -154,11 +154,11 @@ class DeliveryStream( self.delivery_stream_status = "ACTIVE" self.delivery_stream_arn = f"arn:aws:firehose:{region}:{ACCOUNT_ID}:/delivery_stream/{delivery_stream_name}" - self.create_timestamp = datetime.utcnow().isoformat() + self.create_timestamp = datetime.now(timezone.utc).isoformat() self.version_id = "1" # Used to track updates of destination configs # I believe boto3 only adds this field after an update ... - self.last_update_timestamp = datetime.utcnow().isoformat() + self.last_update_timestamp = datetime.now(timezone.utc).isoformat() class FirehoseBackend(BaseBackend): @@ -622,7 +622,7 @@ class FirehoseBackend(BaseBackend): # Increment version number and update the timestamp. delivery_stream.version_id = str(int(current_delivery_stream_version_id) + 1) - delivery_stream.last_update_timestamp = datetime.utcnow().isoformat() + delivery_stream.last_update_timestamp = datetime.now(timezone.utc).isoformat() # Unimplemented: processing of the "S3BackupMode" parameter. Per the # documentation: "You can update a delivery stream to enable Amazon