-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support both Lambda APIs in the example Python stack
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#!/usr/bin/env python3 | ||
from aws_cdk import App | ||
from cdk_python.cdk_python_stack import CdkPythonStack | ||
from cdk_python.cdk_python_lambda_old_api_stack import CdkPythonLambdaOldApiStack | ||
|
||
app = App() | ||
CdkPythonStack(app, "CdkPythonStack") | ||
CdkPythonLambdaOldApiStack(app, "CdkPythonLambdaOldApiStack") | ||
|
||
app.synth() |
27 changes: 27 additions & 0 deletions
27
examples/python-stack/cdk_python/cdk_python_lambda_old_api_stack.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from constructs import Construct | ||
from datadog_cdk_constructs_v2 import Datadog, DatadogProps | ||
import os | ||
from cdk_python.cdk_python_stack_base import CdkPythonStackBase | ||
|
||
class CdkPythonLambdaOldApiStack(CdkPythonStackBase): | ||
def __init__(self, scope: Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
datadog = Datadog( | ||
self, | ||
"Datadog", | ||
dotnet_layer_version=15, | ||
node_layer_version=107, | ||
python_layer_version=89, | ||
extension_layer_version=55, | ||
add_layers=True, | ||
api_key=os.getenv("DD_API_KEY"), | ||
enable_datadog_tracing=True, | ||
enable_datadog_asm=True, | ||
flush_metrics_to_logs=True, | ||
site="datadoghq.com", | ||
) | ||
|
||
# Ensure DatadogProps can be imported properly | ||
props = DatadogProps() | ||
datadog.add_lambda_functions(self.lambdaFunctions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from constructs import Construct | ||
from datadog_cdk_constructs_v2 import DatadogLambda, DatadogLambdaProps | ||
import os | ||
from cdk_python.cdk_python_stack_base import CdkPythonStackBase | ||
|
||
class CdkPythonStack(CdkPythonStackBase): | ||
def __init__(self, scope: Construct, id: str, **kwargs) -> None: | ||
super().__init__(scope, id, **kwargs) | ||
|
||
datadog = DatadogLambda( | ||
self, | ||
"Datadog", | ||
dotnet_layer_version=15, | ||
node_layer_version=107, | ||
python_layer_version=89, | ||
extension_layer_version=55, | ||
add_layers=True, | ||
api_key=os.getenv("DD_API_KEY"), | ||
enable_datadog_tracing=True, | ||
enable_datadog_asm=True, | ||
flush_metrics_to_logs=True, | ||
site="datadoghq.com", | ||
) | ||
|
||
# Ensure DatadogLambdaProps can be imported properly | ||
props = DatadogLambdaProps() | ||
datadog.add_lambda_functions(self.lambdaFunctions) |