Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cdk): Update fact tables and tests for lambda layers v0.90.1 #28567

Merged
merged 11 commits into from
Jan 15, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StackUnderTest extends Stack {
code: Code.fromInline(`exports.handler = ${handler.toString()}`),
architecture: props.architecture,
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.V1_17_1),
layerVersion: AdotLayerVersion.fromJavaScriptSdkLayerVersion(AdotLambdaLayerJavaScriptSdkVersion.V1_18_1),
vasireddy99 marked this conversation as resolved.
Show resolved Hide resolved
execWrapper: AdotLambdaExecWrapper.REGULAR_HANDLER,
},
});
Expand All @@ -43,7 +43,7 @@ class StackUnderTest extends Stack {
handler: 'index.handler',
code: Code.fromInline('def handler(event, context): pass'),
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromPythonSdkLayerVersion(AdotLambdaLayerPythonSdkVersion.V1_20_0_1),
layerVersion: AdotLayerVersion.fromPythonSdkLayerVersion(AdotLambdaLayerPythonSdkVersion.V1_21_0),
execWrapper: AdotLambdaExecWrapper.INSTRUMENT_HANDLER,
},
});
Expand All @@ -53,7 +53,7 @@ class StackUnderTest extends Stack {
handler: 'index.handler',
code: Code.fromInline('def handler(event, context): pass'),
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromJavaSdkLayerVersion(AdotLambdaLayerJavaSdkVersion.V1_31_0),
layerVersion: AdotLayerVersion.fromJavaSdkLayerVersion(AdotLambdaLayerJavaSdkVersion.V1_32_0),
execWrapper: AdotLambdaExecWrapper.INSTRUMENT_HANDLER,
},
});
Expand All @@ -63,7 +63,7 @@ class StackUnderTest extends Stack {
handler: 'index.handler',
code: Code.fromInline('def handler(event, context): pass'),
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromJavaAutoInstrumentationLayerVersion(AdotLambdaLayerJavaAutoInstrumentationVersion.V1_31_0),
layerVersion: AdotLayerVersion.fromJavaAutoInstrumentationLayerVersion(AdotLambdaLayerJavaAutoInstrumentationVersion.V1_32_0),
execWrapper: AdotLambdaExecWrapper.INSTRUMENT_HANDLER,
},
});
Expand All @@ -73,7 +73,7 @@ class StackUnderTest extends Stack {
handler: 'index.handler',
code: Code.fromInline('def handler(event, context): pass'),
adotInstrumentation: {
layerVersion: AdotLayerVersion.fromGenericLayerVersion(AdotLambdaLayerGenericVersion.V0_88_0),
layerVersion: AdotLayerVersion.fromGenericLayerVersion(AdotLambdaLayerGenericVersion.V0_90_1),
execWrapper: AdotLambdaExecWrapper.INSTRUMENT_HANDLER,
},
});
Expand Down
35 changes: 30 additions & 5 deletions packages/aws-cdk-lib/aws-lambda/lib/adot-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ abstract class AdotLambdaLayerVersion {
* The collection of versions of the ADOT Lambda Layer for Java SDK
*/
export class AdotLambdaLayerJavaSdkVersion extends AdotLambdaLayerVersion {
/**
* Version 1.32.0
*/
public static readonly V1_32_0 = new AdotLambdaLayerJavaSdkVersion('1.32.0');

/**
* Version 1.31.0
*/
Expand All @@ -233,7 +238,7 @@ export class AdotLambdaLayerJavaSdkVersion extends AdotLambdaLayerVersion {
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V1_31_0;
public static readonly LATEST = this.V1_32_0;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.JAVA_SDK, layerVersion);
Expand All @@ -244,6 +249,11 @@ export class AdotLambdaLayerJavaSdkVersion extends AdotLambdaLayerVersion {
* The collection of versions of the ADOT Lambda Layer for Java auto-instrumentation
*/
export class AdotLambdaLayerJavaAutoInstrumentationVersion extends AdotLambdaLayerVersion {
/**
* Version 1.32.0
*/
public static readonly V1_32_0 = new AdotLambdaLayerJavaAutoInstrumentationVersion('1.32.0');

/**
* Version 1.31.0
*/
Expand All @@ -268,7 +278,7 @@ export class AdotLambdaLayerJavaAutoInstrumentationVersion extends AdotLambdaLay
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V1_31_0;
public static readonly LATEST = this.V1_32_0;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.JAVA_AUTO_INSTRUMENTATION, layerVersion);
Expand All @@ -279,6 +289,11 @@ export class AdotLambdaLayerJavaAutoInstrumentationVersion extends AdotLambdaLay
* The collection of versions of the ADOT Lambda Layer for Python SDK
*/
export class AdotLambdaLayerPythonSdkVersion extends AdotLambdaLayerVersion {
/**
* Version 1.21.0
*/
public static readonly V1_21_0 = new AdotLambdaLayerPythonSdkVersion('1.21.0');

/**
* Version 1.20.0
*/
Expand Down Expand Up @@ -328,7 +343,7 @@ export class AdotLambdaLayerPythonSdkVersion extends AdotLambdaLayerVersion {
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V1_20_0_1;
public static readonly LATEST = this.V1_21_0;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.PYTHON_SDK, layerVersion);
Expand All @@ -339,6 +354,11 @@ export class AdotLambdaLayerPythonSdkVersion extends AdotLambdaLayerVersion {
* The collection of versions of the ADOT Lambda Layer for JavaScript SDK
*/
export class AdotLambdaLayerJavaScriptSdkVersion extends AdotLambdaLayerVersion {
/**
* Version 1.18.1
*/
public static readonly V1_18_1 = new AdotLambdaLayerJavaScriptSdkVersion('1.18.1');

/**
* Version 1.17.1
*/
Expand All @@ -363,7 +383,7 @@ export class AdotLambdaLayerJavaScriptSdkVersion extends AdotLambdaLayerVersion
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V1_17_1;
public static readonly LATEST = this.V1_18_1;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.JAVASCRIPT_SDK, layerVersion);
Expand All @@ -374,6 +394,11 @@ export class AdotLambdaLayerJavaScriptSdkVersion extends AdotLambdaLayerVersion
* The collection of versions of the ADOT Lambda Layer for generic purpose
*/
export class AdotLambdaLayerGenericVersion extends AdotLambdaLayerVersion {
/**
* Version 0.90.1
*/
public static readonly V0_90_1 = new AdotLambdaLayerGenericVersion('0.90.1');

/**
* Version 0.88.0
*/
Expand All @@ -398,7 +423,7 @@ export class AdotLambdaLayerGenericVersion extends AdotLambdaLayerVersion {
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V0_88_0;
public static readonly LATEST = this.V0_90_1;
private constructor(protected readonly layerVersion: string) {
vasireddy99 marked this conversation as resolved.
Show resolved Hide resolved
super(AdotLambdaLayerType.GENERIC, layerVersion);
}
Expand Down
14 changes: 7 additions & 7 deletions packages/aws-cdk-lib/aws-lambda/test/adot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ describe('ADOT Lambda Layer', () => {
});

test('is added properly when the region information is available at synthesis time', () => {
const layerArn = lambda.AdotLambdaLayerJavaSdkVersion.V1_31_0.layerArn(fn.stack, fn.architecture);
const layerArn = lambda.AdotLambdaLayerJavaSdkVersion.V1_32_0.layerArn(fn.stack, fn.architecture);
vasireddy99 marked this conversation as resolved.
Show resolved Hide resolved

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-31-0:1',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:1',
);
});

test('is added properly when using "LATEST" version', () => {
const layerArn = lambda.AdotLambdaLayerJavaSdkVersion.LATEST.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-31-0:1',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:1',
);
});
});
Expand All @@ -53,18 +53,18 @@ describe('ADOT Lambda Layer', () => {
});

test('is added properly when the region information is available at synthesis time', () => {
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.V1_20_0_1.layerArn(fn.stack, fn.architecture);
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.V1_21_0.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-20-0:3',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-21-0:1',
);
});

test('is added properly when using "LATEST" version', () => {
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.LATEST.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-20-0:3',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-21-0:1',
);
});
});
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('ADOT Lambda Layer', () => {
{
Ref: 'AWS::Region',
},
':901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-31-0:1',
':901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-32-0:1',
],
],
},
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-lambda/test/function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3283,7 +3283,7 @@ describe('function', () => {

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-31-0:1'],
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:1'],
Environment: {
Variables: {
AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-handler',
Expand Down Expand Up @@ -3312,7 +3312,7 @@ describe('function', () => {

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-20-0:3'],
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-21-0:1'],
Environment: {
Variables: {
AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-instrument',
Expand Down
Loading
Loading