Skip to content

[Bug Fix] Allow specifying lambda layer account id to avoid deployment failure when version is specified - #55

Open
VardyNg wants to merge 2 commits into
awslabs:mainfrom
VardyNg:feat/lambda-insights-account
Open

[Bug Fix] Allow specifying lambda layer account id to avoid deployment failure when version is specified#55
VardyNg wants to merge 2 commits into
awslabs:mainfrom
VardyNg:feat/lambda-insights-account

Conversation

@VardyNg

@VardyNg VardyNg commented Jul 6, 2026

Copy link
Copy Markdown

Issue #, if available: #54

Description of changes:

  • added new optional lambdaInsightsAccount parameter
  • updated code to handle lambdaInsightsAccount to override the default account id, if provided.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

VardyNg added 2 commits July 6, 2026 14:51
- Add lambdaInsightsAccount configuration option to allow custom AWS account IDs
- Define defaultLambdaInsightsAccount constant for standard AWS-managed layer
- Update generateLayerARN to accept and use custom account parameter
- Add checkLambdaInsightsAccount validation method for account ID type checking
- Pass layerAccount through addLambdaInsightsToFunctions call chain
- Extract and validate lambdaInsightsAccount from plugin configuration
- Update test helper createServerless to support custom account parameter
- Add test case for custom account with explicit version
- Add test case validating account parameter type validation
- Improve ARN matching in tests using regex pattern for account flexibility
- Fix formatting inconsistencies and whitespace issues in tests
- Add `lambdaInsightsAccount` parameter to custom configuration example
- Include note explaining when `lambdaInsightsAccount` takes effect
- Document that setting only applies when `lambdaInsightsVersion` is explicitly set
- Reference AWS documentation for per-region account IDs
- Clarify that bundled mappings are used when no explicit version is specified
@VardyNg

VardyNg commented Jul 6, 2026

Copy link
Copy Markdown
Author

Setting it as a draft for now, working on testing by deploying with the latest serverless framework

@VardyNg

VardyNg commented Jul 7, 2026

Copy link
Copy Markdown
Author

Tested and it is working as expected, I have put the test in here:

https://github.com/VardyNg/serverless-lambda-insight-test

Please refer to the README for the test plan and result https://github.com/VardyNg/serverless-lambda-insight-test/blob/6bf6daf88a0d5624e4d75a97f4732ce78d699a0e/README.md?plain=1#L12-L141

@VardyNg
VardyNg marked this pull request as ready for review July 7, 2026 19:40
@VardyNg VardyNg changed the title Feat/lambda insights account [Bug Fix Jul 7, 2026
@VardyNg VardyNg changed the title [Bug Fix [Bug Fix] Allow specifying lambda layer account id to avoid deployment failure when version is specified Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant