Skip to content

Commit f439859

Browse files
authored
scripts/datadog_wrapper: set up the runtime api proxy with appsec (#158)
1 parent e5e2fcc commit f439859

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/datadog_wrapper

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@ args=("$@")
33

44
# lowercase DD_LOG_LEVEL
55
DD_LOG_LEVEL=$(echo "$DD_LOG_LEVEL" | tr '[:upper:]' '[:lower:]')
6+
DD_SERVERLESS_APPSEC_ENABLED=$(echo "$DD_SERVERLESS_APPSEC_ENABLED" | tr '[:upper:]' '[:lower:]')
67

7-
if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ]
8+
if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ] || [[ "$DD_SERVERLESS_APPSEC_ENABLED" =~ ^(1|t|true)$ ]]
89
then
910
if [ "$DD_LOG_LEVEL" == "debug" ]
1011
then
11-
echo "[bootstrap] DD_EXPERIMENTAL_ENABLE_PROXY is true"
12+
echo "[bootstrap] runtime api proxy mode"
1213
echo "[bootstrap] original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API"
1314
fi
1415

16+
# Replace the Runtime API address with the proxy address of the extension
1517
export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000"
1618

1719
if [ "$DD_LOG_LEVEL" == "debug" ]
1820
then
19-
echo "[bootstrap] rerouting AWS_LAMBDA_RUNTIME_API to $AWS_LAMBDA_RUNTIME_API"
21+
echo "[bootstrap] rerouting AWS_LAMBDA_RUNTIME_API to the Datadog extension at $AWS_LAMBDA_RUNTIME_API"
2022
fi
2123
fi
2224

0 commit comments

Comments
 (0)