-
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.
chore: rename Lambda related interfaces
- Loading branch information
Showing
20 changed files
with
1,021 additions
and
114 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
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
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,7 +1,9 @@ | ||
#!/usr/bin/env node | ||
import * as cdk from "aws-cdk-lib"; | ||
import { CdkTypeScriptStack } from "../lib/cdk-typescript-stack"; | ||
import { CdkTypeScriptLambdaOldApiStack } from "../lib/cdk-typescript-lambda-old-api-stack"; | ||
|
||
const app = new cdk.App(); | ||
new CdkTypeScriptStack(app, "CdkTypeScriptStack", {}); | ||
new CdkTypeScriptLambdaOldApiStack(app, "CdkTypeScriptLambdaOldApiStack", {}); | ||
app.synth(); |
29 changes: 29 additions & 0 deletions
29
examples/typescript-stack/lib/cdk-typescript-lambda-old-api-stack.ts
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,29 @@ | ||
import { StackProps } from "aws-cdk-lib"; | ||
import { Construct } from "constructs"; | ||
import { Datadog, DatadogProps } from "datadog-cdk-constructs-v2"; | ||
import { CdkTypeScriptStackBase } from "./cdk-typescript-stack-base"; | ||
|
||
export class CdkTypeScriptLambdaOldApiStack extends CdkTypeScriptStackBase { | ||
constructor(scope: Construct, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
console.log("Instrumenting Lambda Functions in TypeScript stack using the old Datadog Lambda API"); | ||
|
||
const datadogProps: DatadogProps = { | ||
dotnetLayerVersion: 15, | ||
nodeLayerVersion: 108, | ||
pythonLayerVersion: 89, | ||
extensionLayerVersion: 55, | ||
addLayers: true, | ||
apiKey: process.env.DD_API_KEY, | ||
enableDatadogTracing: true, | ||
enableDatadogASM: true, | ||
flushMetricsToLogs: true, | ||
site: "datadoghq.com", | ||
}; | ||
|
||
const datadog = new Datadog(this, "Datadog", datadogProps); | ||
|
||
datadog.addLambdaFunctions(this.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
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
Oops, something went wrong.