The suite runs the DatadogLambda construct against a temporary AWS Lambda function:
- Deploy the uninstrumented function.
- Apply the construct and verify its layers, handler, runtime, environment, and tags.
- Invoke the function and wait for matching spans and logs in Datadog.
- Confirm
cdk diff --failreports no changes. - Destroy the stack and verify the function is gone.
Layer and runtime versions are pinned in helpers/versions.ts.
You need Node 22+, Yarn, AWS credentials for a CDK-bootstrapped account, and Datadog API and application keys for the serverless org.
aws-vault exec sso-serverless-sandbox-account-admin -- \
dd-auth --domain ddserverless.datadoghq.com -- bash -c '
export DATADOG_API_KEY="$DD_API_KEY" DATADOG_APP_KEY="$DD_APP_KEY"
yarn test:e2e
'The suite defaults to ap-northeast-3 and datadoghq.com. Set AWS_REGION or DD_SITE to override them.
The E2E workflow runs when the construct or suite changes. It assumes the repository's AWS role through GitHub OIDC and obtains short-lived Datadog keys through dd-sts; missing credentials fail the run.
The workflow uses AWS_ROLE_ARN_E2E, AWS_REGION_E2E, and DD_SITE_E2E repository variables. The AWS account must be CDK-bootstrapped.
Each run uses a unique one-e2e-cdk-lambda-<runid> name and stamps its run ID and creation time on the function. The test always attempts cdk destroy; the cross-repository sweeper removes resources left by interrupted runs.