Skip to content

feat: new-scripts#21

Merged
dannysteenman merged 2 commits intomainfrom
feat/new-scripts
Feb 17, 2023
Merged

feat: new-scripts#21
dannysteenman merged 2 commits intomainfrom
feat/new-scripts

Conversation

@dannysteenman
Copy link
Copy Markdown
Member

@dannysteenman dannysteenman commented Feb 17, 2023

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Docstrings or comments have been reviewed and added / updated if needed
  • The change has been tested and confirmed working (Tested on? OS, AWS CLI Version)

Pull request type

Please check the type of change your PR introduces:

  • Bugfix (if it's an open issue, please add the issue number):
  • Feature e.g. new script (please describe):
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Other information

@dannysteenman dannysteenman merged commit 55919fa into main Feb 17, 2023
@dannysteenman dannysteenman deleted the feat/new-scripts branch February 17, 2023 19:10
dannysteenman added a commit that referenced this pull request Mar 19, 2026
…BRN-AWS-LAMBDA-1) (#21)

* feat(rules): implement evaluators for CLDBRN-AWS-LAMBDA-1

Add evaluateLive and evaluateStatic to the Lambda cost-optimal
architecture rule. The rule flags Lambda functions using x86_64
when arm64 (Graviton2) offers ~20% lower cost.

- Add AwsLambdaFunction type and extend LiveEvaluationContext
- Export AwsLambdaFunction from package index
- evaluateLive: filter functions missing arm64 architecture
- evaluateStatic: check Terraform aws_lambda_function and
  CloudFormation AWS::Lambda::Function (absent = x86_64 default)

* feat(sdk): add Lambda function discoverer and wire into scanner

- Add @aws-sdk/client-lambda dependency
- Add createLambdaClient factory in client.ts
- Create discoverAwsLambdaFunctions using paginateListFunctions
- Wire lambdaFunctions into scanAwsResources with shared region resolution
- Update scanner tests for the new discoverer

* docs: update CLDBRN-AWS-LAMBDA-1 status to Implemented and add changesets

* fix(rules): clarify Lambda rule message with actionable guidance

Reword from vague "should use the most cost-optimal architecture" to
specific "running x86_64 should be upgraded to arm64 (Graviton2),
which is on average 20% cheaper."

* feat(sdk): add accountId to live discovery findings

Resolve the AWS account ID once via STS GetCallerIdentity in the
scanner (same pattern as resolveAwsRegions) and thread it through
all discoverers into resource types and FindingMatch output.

- Add accountId to AwsEbsVolume and AwsLambdaFunction types
- Add resolveAwsAccountId using @aws-sdk/client-sts
- Update EBS and Lambda discoverers to accept and include accountId
- Update scanner to resolve accountId in parallel with regions
- Update all rule evaluators to emit accountId in discovery findings

* fix(sdk): address review feedback for Lambda rule

- Shorten rule message to actionable guidance
- Skip computed/intrinsic architectures in static evaluation instead
  of false-flagging (Terraform variable refs, CloudFormation Ref)
- Run discoverers in parallel with Promise.allSettled for concurrency
  and partial failure resilience in both scanner and discoverer
- Add Lambda discoverer unit tests (pagination, filtering, defaults,
  partial region failure)
- Add scanner integration test for Lambda findings in live scan output
- Add scanner concurrency and partial failure tests

* fix: finalize lambda discovery review fixes
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