-
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: Rename: Datadog -> DatadogLambda
- Loading branch information
Showing
22 changed files
with
1,265 additions
and
1,175 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
52 changes: 52 additions & 0 deletions
52
integration_tests/stacks/lambda-function-stack-legacy-datadog-api.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,52 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed | ||
* under the Apache License Version 2.0. | ||
* | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2021 Datadog, Inc. | ||
*/ | ||
|
||
import * as lambda from "aws-cdk-lib/aws-lambda"; | ||
import { Stack, StackProps, App } from "aws-cdk-lib"; | ||
import { LambdaRestApi, LogGroupLogDestination } from "aws-cdk-lib/aws-apigateway"; | ||
import { LogGroup } from "aws-cdk-lib/aws-logs"; | ||
// use the legacy Datadog class instead of the new DatadogLambda | ||
import { Datadog } from "../../src/index"; | ||
|
||
export class ExampleStack extends Stack { | ||
constructor(scope: App, id: string, props?: StackProps) { | ||
super(scope, id, props); | ||
|
||
const lambdaFunction = new lambda.Function(this, "HelloHandler", { | ||
runtime: lambda.Runtime.NODEJS_14_X, | ||
code: lambda.Code.fromInline("test"), | ||
handler: "lambdaFunction.handler", | ||
}); | ||
|
||
const restLogGroup = new LogGroup(this, "restLogGroup"); | ||
new LambdaRestApi(this, "rest-test", { | ||
handler: lambdaFunction, | ||
deployOptions: { | ||
accessLogDestination: new LogGroupLogDestination(restLogGroup), | ||
}, | ||
}); | ||
|
||
const datadog = new Datadog(this, "Datadog", { | ||
nodeLayerVersion: 62, | ||
extensionLayerVersion: 10, | ||
enableDatadogTracing: true, | ||
flushMetricsToLogs: true, | ||
sourceCodeIntegration: false, | ||
apiKey: "1234", | ||
site: "datadoghq.com", | ||
}); | ||
datadog.addLambdaFunctions([lambdaFunction]); | ||
datadog.addForwarderToNonLambdaLogGroups([restLogGroup]); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
const env = { account: "601427279990", region: "sa-east-1" }; | ||
const stack = new ExampleStack(app, "lambda-function-stack", { env: env }); | ||
console.log("Stack name: " + stack.stackName); | ||
app.synth(); |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.