Skip to content

Commit

Permalink
chore(lambda): update Cloudwatch Lambda insights versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Costa committed May 16, 2024
1 parent 7624c62 commit 2c9f99d
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/aws-cdk-lib/aws-lambda/lib/lambda-insights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ export abstract class LambdaInsightsVersion {
*/
public static readonly VERSION_1_0_229_0 = LambdaInsightsVersion.fromInsightsVersion('1.0.229.0');

/**
* Version 1.0.273.0
*/
public static readonly VERSION_1_0_273_0 = LambdaInsightsVersion.fromInsightsVersion('1.0.273.0');

/**
* Version 1.0.275.0
*/
public static readonly VERSION_1_0_275_0 = LambdaInsightsVersion.fromInsightsVersion('1.0.275.0');

/**
* Version 1.0.295.0
*/
public static readonly VERSION_1_0_295_0 = LambdaInsightsVersion.fromInsightsVersion('1.0.295.0');

/**
* Version 1.0.317.0
* Important - this version includes the removal of support for the Amazon Linux 1 platform.
*/
public static readonly VERSION_1_0_317_0 = LambdaInsightsVersion.fromInsightsVersion('1.0.317.0');

/**
* 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.VERSION_1_0_317_0

/**
* Use the insights extension associated with the provided ARN. Make sure the ARN is associated
* with same region as your function
Expand Down
11 changes: 11 additions & 0 deletions packages/aws-cdk-lib/aws-lambda/test/lambda-insights.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,15 @@ describe('lambda-insights', () => {
Layers: ['arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension:21'],
});
});
test('LATEST links to v1.0.317.0', () => {
const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack', {
env: { account: '123456789012', region: 'us-east-1' },
});
functionWithInsightsVersion(stack, 'MyLambda', lambda.LambdaInsightsVersion.LATEST, lambda.Architecture.X86_64);

Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Layers: ['arn:aws:lambda:us-east-1:580247275435:layer:LambdaInsightsExtension:52'],
});
});
});
Loading

0 comments on commit 2c9f99d

Please sign in to comment.