-
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 TypeScript stack
- Loading branch information
Showing
4 changed files
with
35 additions
and
4 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,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