Skip to content

Commit 5a95beb

Browse files
authored
Merge pull request DataDog#152 from c-py/master
Decode DD_API_KEY into UTF-8
2 parents 6092bbf + 4a25e8a commit 5a95beb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

aws/logs_monitoring/lambda_function.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ def compileRegex(rule, pattern):
178178
DD_API_KEY = boto3.client("kms").decrypt(
179179
CiphertextBlob=base64.b64decode(ENCRYPTED)
180180
)["Plaintext"]
181+
if type(DD_API_KEY) is bytes:
182+
DD_API_KEY = DD_API_KEY.decode("utf-8")
181183
elif "DD_API_KEY" in os.environ:
182184
DD_API_KEY = os.environ["DD_API_KEY"]
183185

0 commit comments

Comments
 (0)