Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aws/logs_monitoring/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ def compileRegex(rule, pattern):

# Strip any trailing and leading whitespace from the API key
DD_API_KEY = DD_API_KEY.strip()
os.environ["DD_API_KEY"] = DD_API_KEY

# Force the layer to use the exact same API key as the forwarder
if DD_FORWARD_METRIC:
from datadog import api
api._api_key = DD_API_KEY

# DD_API_KEY must be set
if DD_API_KEY == "<YOUR_DATADOG_API_KEY>" or DD_API_KEY == "":
Expand Down
2 changes: 1 addition & 1 deletion aws/logs_monitoring/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Resources:
- { DdForwarderVersion: !FindInMap [Constants, DdForwarder, Version] }
Layers:
- Fn::Sub: arn:aws:lambda:${AWS::Region}:464622532012:layer:Datadog-Python37:11
- Fn::Sub: arn:aws:lambda:${AWS::Region}:464622532012:layer:Datadog-Trace-Forwarder-Python37:3
- Fn::Sub: arn:aws:lambda:${AWS::Region}:464622532012:layer:Datadog-Trace-Forwarder-Python37:4
Tags:
dd_forwarder_version: !FindInMap [Constants, DdForwarder, Version]
Environment:
Expand Down