Skip to content

Commit 78a4a3c

Browse files
committed
feat: Support both Lambda APIs in the example Python stack
1 parent ab806da commit 78a4a3c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

examples/python-stack/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env python3
22
from aws_cdk import App
33
from cdk_python.cdk_python_stack import CdkPythonStack
4+
from cdk_python.cdk_python_lambda_old_api_stack import CdkPythonLambdaOldApiStack
45

56
app = App()
67
CdkPythonStack(app, "CdkPythonStack")
8+
CdkPythonLambdaOldApiStack(app, "CdkPythonLambdaOldApiStack")
79

810
app.synth()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from constructs import Construct
2+
from datadog_cdk_constructs_v2 import Datadog, DatadogProps
3+
import os
4+
from cdk_python.cdk_python_stack_base import CdkPythonStackBase
5+
6+
class CdkPythonLambdaOldApiStack(CdkPythonStackBase):
7+
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
8+
super().__init__(scope, id, **kwargs)
9+
10+
datadog = Datadog(
11+
self,
12+
"Datadog",
13+
dotnet_layer_version=15,
14+
node_layer_version=107,
15+
python_layer_version=89,
16+
extension_layer_version=55,
17+
add_layers=True,
18+
api_key=os.getenv("DD_API_KEY"),
19+
enable_datadog_tracing=True,
20+
enable_datadog_asm=True,
21+
flush_metrics_to_logs=True,
22+
site="datadoghq.com",
23+
)
24+
25+
# Ensure DatadogProps can be imported properly
26+
props = DatadogProps()
27+
datadog.add_lambda_functions(self.lambdaFunctions)

0 commit comments

Comments
 (0)