Skip to content
Closed
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
2 changes: 1 addition & 1 deletion aws/logs_monitoring/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_bool_env_var(envvar, default):
## * Datadog US Site: https://app.datadoghq.com/account/settings#api
## * Datadog EU Site: https://app.datadoghq.eu/account/settings#api
#
DD_API_KEY = "<YOUR_DATADOG_API_KEY>"
DD_API_KEY = os.getenv("DD_API_KEY", default="<YOUR_DATADOG_API_KEY>")

## @param DD_FORWARD_LOG - boolean - optional - default: true
## Set this variable to `False` to disable log forwarding.
Expand Down
14 changes: 14 additions & 0 deletions aws/logs_monitoring/log-sam-template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Pushes logs and metrics from AWS to Datadog.
Parameters:
DatadogApiKey:
Type: 'String'
NoEcho: true
MinLength: 32
MaxLength: 32
AllowedPattern: ^[a-fA-F0-9]*$
DatadogSite:
Type: 'String'
Default: 'datadoghq.com'
Resources:
loglambdaddfunction:
Type: 'AWS::Serverless::Function'
Expand All @@ -13,5 +23,9 @@ Resources:
Layers:
- !Sub 'arn:aws:lambda:${AWS::Region}:464622532012:layer:Datadog-Python27:3'
- !Sub 'arn:aws:lambda:${AWS::Region}:464622532012:layer:Datadog-Trace-Forwarder-Python27:1'
Environment:
Variables:
DD_API_KEY: !Ref 'DatadogApiKey'
DD_SITE: !Ref 'DatadogSite'

Type: AWS::Serverless::Function