Skip to content

Commit 4a25e8a

Browse files
authored
Update lambda_function.py
1 parent 14933f3 commit 4a25e8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

aws/logs_monitoring/lambda_function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def compileRegex(rule, pattern):
108108
DD_API_KEY = boto3.client("kms").decrypt(
109109
CiphertextBlob=base64.b64decode(ENCRYPTED)
110110
)["Plaintext"]
111-
DD_API_KEY = DD_API_KEY.decode("utf-8")
111+
if type(DD_API_KEY) is bytes:
112+
DD_API_KEY = DD_API_KEY.decode("utf-8")
112113
elif "DD_API_KEY" in os.environ:
113114
DD_API_KEY = os.environ["DD_API_KEY"]
114115

0 commit comments

Comments
 (0)