Skip to content

🐛 Fix Lambda function init lookup by name+region#6923

Merged
vjeffrey merged 1 commit intomainfrom
tsmith/fix-lambda-init-lookup
Mar 16, 2026
Merged

🐛 Fix Lambda function init lookup by name+region#6923
vjeffrey merged 1 commit intomainfrom
tsmith/fix-lambda-init-lookup

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 16, 2026

Summary

  • Bug: initAwsLambdaFunction constructed a lookup ARN with an empty account ID when called with name and region (no arn), producing e.g. arn:aws:lambda:us-east-1::function:myFunc. This never matched real function ARNs which contain the account ID, so the lookup always returned "lambda function does not exist".
  • Fix: Retrieve the account ID from the AWS connection (runtime.Connection.(*connection.AwsConnection).AccountId()) and pass it to getLambdaArn, so the constructed ARN includes the correct account ID and matches properly.

Test plan

  • Build the AWS provider (make providers/build/aws && make providers/install/aws)
  • Run mql run aws -c "aws.lambda.function(name: \"<function-name>\", region: \"<region>\")" and verify it resolves correctly instead of returning "lambda function does not exist"
  • Verify that lookup by ARN still works: mql run aws -c "aws.lambda.function(arn: \"arn:aws:lambda:...\")"

🤖 Generated with Claude Code

initAwsLambdaFunction constructed a lookup ARN with an empty account ID,
which never matched real function ARNs. Pass the connection's account ID
to getLambdaArn so the constructed ARN matches correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes Lambda function lookup by name+region to produce a valid ARN with the account ID.

@tas50 tas50 changed the title Fix Lambda function init lookup by name+region 🐛 Fix Lambda function init lookup by name+region Mar 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

5 452 tests   5 448 ✅  2m 9s ⏱️
  412 suites      4 💤
   31 files        0 ❌

Results for commit 11bf604.

@vjeffrey vjeffrey merged commit 0cdb80c into main Mar 16, 2026
22 checks passed
@vjeffrey vjeffrey deleted the tsmith/fix-lambda-init-lookup branch March 16, 2026 16:21
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants