AdotLambdaLayerJavaScriptSdkVersion Class
The collection of versions of the ADOT Lambda Layer for JavaScript SDK.
Note: These are legacy ADOT Lambda layers with an embedded collector.
| Source | aws-lambda/lib/adot-layers.ts |
|---|---|
| Type last changed |
Example
ts
import {
AdotLambdaExecWrapper,
AdotLayerVersion,
AdotLambdaLayerJavaScriptSdkVersion,
} from 'aws-cdk-lib/aws-lambda';
const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.LATEST),
execWrapper: AdotLambdaExecWrapper.REGULAR_HANDLER,
},
});
python
from aws_cdk.aws_lambda import AdotLambdaExecWrapper, AdotLayerVersion, AdotLambdaLayerJavaScriptSdkVersion
fn = lambda_.Function(self, "MyFunction",
runtime=lambda_.Runtime.NODEJS_LATEST,
handler="index.handler",
code=lambda_.Code.from_inline("exports.handler = function(event, ctx, cb) { return cb(null, \"hi\"); }"),
adot_instrumentation=lambda.AdotInstrumentationConfig(
layer_version=AdotLayerVersion.from_java_script_sdk_layer_version(AdotLambdaLayerJavaScriptSdkVersion.LATEST),
exec_wrapper=AdotLambdaExecWrapper.REGULAR_HANDLER
)
)
java
import software.amazon.awscdk.services.lambda.AdotLambdaExecWrapper;
import software.amazon.awscdk.services.lambda.AdotLayerVersion;
import software.amazon.awscdk.services.lambda.AdotLambdaLayerJavaScriptSdkVersion;
Function fn = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_LATEST)
.handler("index.handler")
.code(Code.fromInline("exports.handler = function(event, ctx, cb) { return cb(null, \"hi\"); }"))
.adotInstrumentation(AdotInstrumentationConfig.builder()
.layerVersion(AdotLayerVersion.fromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.LATEST))
.execWrapper(AdotLambdaExecWrapper.REGULAR_HANDLER)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Lambda;
var fn = new Function(this, "MyFunction", new FunctionProps {
Runtime = Runtime.NODEJS_LATEST,
Handler = "index.handler",
Code = Code.FromInline("exports.handler = function(event, ctx, cb) { return cb(null, \"hi\"); }"),
AdotInstrumentation = new AdotInstrumentationConfig {
LayerVersion = AdotLayerVersion.FromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.LATEST),
ExecWrapper = AdotLambdaExecWrapper.REGULAR_HANDLER
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"
fn := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
Runtime: lambda.Runtime_NODEJS_LATEST(),
Handler: jsii.String("index.handler"),
Code: lambda.Code_FromInline(jsii.String("exports.handler = function(event, ctx, cb) { return cb(null, \"hi\"); }")),
AdotInstrumentation: &AdotInstrumentationConfig{
LayerVersion: awscdk.AdotLayerVersion_FromJavaScriptSdkLayerVersion(awscdk.AdotLambdaLayerJavaScriptSdkVersion_LATEST()),
ExecWrapper: awscdk.AdotLambdaExecWrapper_REGULAR_HANDLER,
},
})
Properties
LATESTAdotLambdaLayerJavaScriptSdkVersionLATESTAdotLambdaLayerJavaScriptSdkVersionLATESTAdotLambdaLayerJavaScriptSdkVersionLATESTAdotLambdaLayerJavaScriptSdkVersionLATESTAdotLambdaLayerJavaScriptSdkVersion static #The latest layer version available in this CDK version.
New versions could introduce incompatible changes. Make sure to test them before deploying to production.
V1_15_0_1AdotLambdaLayerJavaScriptSdkVersionV1_15_0_1AdotLambdaLayerJavaScriptSdkVersionV1_15_0_1AdotLambdaLayerJavaScriptSdkVersionV1_15_0_1AdotLambdaLayerJavaScriptSdkVersionV1_15_0_1AdotLambdaLayerJavaScriptSdkVersion static #Version 1.15.0.
V1_16_0AdotLambdaLayerJavaScriptSdkVersionV1_16_0AdotLambdaLayerJavaScriptSdkVersionV1_16_0AdotLambdaLayerJavaScriptSdkVersionV1_16_0AdotLambdaLayerJavaScriptSdkVersionV1_16_0AdotLambdaLayerJavaScriptSdkVersion static #Version 1.16.0.
V1_17_1AdotLambdaLayerJavaScriptSdkVersionV1_17_1AdotLambdaLayerJavaScriptSdkVersionV1_17_1AdotLambdaLayerJavaScriptSdkVersionV1_17_1AdotLambdaLayerJavaScriptSdkVersionV1_17_1AdotLambdaLayerJavaScriptSdkVersion static #Version 1.17.1.
V1_18_1AdotLambdaLayerJavaScriptSdkVersionV1_18_1AdotLambdaLayerJavaScriptSdkVersionV1_18_1AdotLambdaLayerJavaScriptSdkVersionV1_18_1AdotLambdaLayerJavaScriptSdkVersionV1_18_1AdotLambdaLayerJavaScriptSdkVersion static #Version 1.18.1.
V1_30_0AdotLambdaLayerJavaScriptSdkVersionV1_30_0AdotLambdaLayerJavaScriptSdkVersionV1_30_0AdotLambdaLayerJavaScriptSdkVersionV1_30_0AdotLambdaLayerJavaScriptSdkVersionV1_30_0AdotLambdaLayerJavaScriptSdkVersion static #Version 1.30.0.
V1_7_0AdotLambdaLayerJavaScriptSdkVersionV1_7_0AdotLambdaLayerJavaScriptSdkVersionV1_7_0AdotLambdaLayerJavaScriptSdkVersionV1_7_0AdotLambdaLayerJavaScriptSdkVersionV1_7_0AdotLambdaLayerJavaScriptSdkVersion static #Version 1.7.0.
Methods
layerArn(scope: IConstruct, architecture: Architecture): stringdef layer_arn(self, scope: IConstruct, architecture: Architecture) -> strpublic String layerArn(IConstruct scope, Architecture architecture)public string LayerArn(IConstruct scope, Architecture architecture)func LayerArn(Scope IConstruct, Architecture Architecture) *string #The ARN of the Lambda layer.
2 parameters
Parameters
scopescopescopescopeScope— The binding scope.architecturearchitecturearchitecturearchitectureArchitecture— The architecture of the Lambda layer (either X86_64 or ARM_64).