Skip to content

feat(lambda): add AWS Lambda integration with 50 operations - #7216

Merged
waleedlatif1 merged 5 commits into
stagingfrom
feat/aws-lambda-integration
Aug 28, 2026
Merged

feat(lambda): add AWS Lambda integration with 50 operations#7216
waleedlatif1 merged 5 commits into
stagingfrom
feat/aws-lambda-integration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an AWS Lambda block with 50 operations covering invocation, function CRUD, versions and aliases, resource-based permissions, event source mappings, reserved and provisioned concurrency, function URLs, async invocation configs, layers, tags, account settings, recursion detection, and runtime management
  • Tools run in-process through the shared internal tool-operation boundary using @aws-sdk/client-lambda; every request and response is contract-bound, with shared response projections for the FunctionConfiguration, alias, event source mapping, function URL, provisioned concurrency, and layer types
  • Contracts carry the documented AWS bounds and enums, plus cross-field guards so a missing code source or a Manual runtime policy without a version ARN fails at the boundary with a named field instead of an opaque AWS error
  • Deployment packages come from Amazon S3 or a container image URI — inline .zip upload is not supported, and the docs page says so

Type of Change

  • New feature

Testing

  • 145 new tests across the block, the SDK client mappers, the operations, and the tool-operation adapter
  • bun run type-check clean; all 38 check:audits pass, including check:api-validation:strict, docs:check, integration-catalog:check, check:tool-request-boundary, and check:bare-icons
  • 7,635 tests pass across the blocks, tools, contracts, and tool-operation registry suites
  • Verified every operation's request fields, response shapes, numeric bounds, and enum sets against the AWS Lambda API Reference
  • Mutation-checked the params guard: reverted it, watched the test go red, restored it

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Adds an AWS Lambda block covering every major resource family: invocation,
function CRUD, versions and aliases, resource-based permissions, event source
mappings, reserved and provisioned concurrency, function URLs, asynchronous
invocation configs, layers, tags, account settings, recursion detection, and
runtime management.

Tools run in-process through the shared internal tool-operation boundary using
@aws-sdk/client-lambda. Request and response shapes are contract-bound, with
shared response projections for the FunctionConfiguration, alias, event source
mapping, function URL, provisioned concurrency, and layer types.

Deployment packages are sourced from Amazon S3 or a container image URI; inline
.zip upload is not supported.
@waleedlatif1
waleedlatif1 requested a review from a team as a code owner August 28, 2026 09:18
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 28, 2026 10:12am

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds an in-process AWS Lambda integration with workflow-block configuration, validated operation contracts, SDK command mapping, generated registry/catalog metadata, documentation, and broad test coverage.

  • Adds 50 Lambda operations spanning invocation, function lifecycle, aliases, permissions, event sources, concurrency, URLs, async configuration, layers, tags, and runtime controls.
  • Preserves explicit empty-array clearing while treating blank optional update fields as unchanged.
  • Separates Lambda’s function timeout from the shared tool executor’s request deadline.
  • Normalizes and validates VPC updates so both subnet and security-group lists are supplied together.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported Lambda update, VPC, and timeout failures are resolved at the current head.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/lambda.ts Defines the Lambda workflow block and now distinguishes explicit empty-array clearing from blank fields while using functionTimeout.
apps/sim/lib/internal/lambda/operations.ts Maps validated operation inputs to AWS SDK commands, including complete VPC normalization and the renamed function timeout.
apps/sim/lib/internal/lambda/execute-tool.ts Enforces contract parsing before dispatching Lambda operations through the internal execution boundary.
apps/sim/lib/api/contracts/tools/aws/lambda-update-function-configuration.ts Validates update configuration bounds and requires VPC subnet and security-group lists to be supplied together.
apps/sim/tools/lambda/update_function_configuration.ts Declares user-facing update parameters and forwards explicit empty collections and functionTimeout to the validated operation.
apps/sim/tools/lambda/supplied.ts Preserves intentionally supplied empty arrays while omitting nullish values.
apps/sim/blocks/blocks/lambda.test.ts Covers explicit collection clearing, blank-field preservation, and block parameter transformation.
apps/sim/lib/internal/lambda/operations.test.ts Exercises SDK command mappings, including complete VPC detach objects.
apps/sim/lib/internal/lambda/execute-tool.test.ts Verifies contract rejection of one-sided VPC updates before operation dispatch.

Sequence Diagram

sequenceDiagram
  participant W as Workflow Block
  participant T as Tool Boundary
  participant C as Lambda Contract
  participant O as Lambda Operation
  participant A as AWS Lambda
  W->>T: Operation and transformed parameters
  T->>C: Validate request contract
  alt Invalid input
    C-->>T: Structured validation error
    T-->>W: Failed tool result
  else Valid input
    C->>O: Validated operation input
    O->>A: AWS SDK command
    A-->>O: Lambda response
    O-->>T: Contract-shaped output
    T-->>W: Successful tool result
  end
Loading

Reviews (5): Last reviewed commit: "fix(lambda): never send a half-configure..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/lambda.ts Outdated
Comment thread apps/sim/lib/internal/lambda/operations.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed against the latest diff

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/blocks/blocks/lambda.ts Outdated
Comment thread apps/sim/tools/lambda/get_function_configuration.ts
Comment thread apps/sim/tools/lambda/update_function_code.ts
Comment thread apps/sim/blocks/blocks/lambda.ts Outdated
Comment thread apps/sim/lib/api/contracts/tools/aws/lambda-create-function.ts
Comment thread apps/sim/tools/lambda/delete_provisioned_concurrency_config.ts Outdated
Comment thread apps/sim/tools/lambda/invoke.ts Outdated
Comment thread apps/sim/tools/lambda/list_layer_versions.ts Outdated
Comment thread apps/sim/tools/lambda/delete_function_url_config.ts Outdated
Comment thread apps/sim/tools/lambda/get_layer_version.ts Outdated
An empty list field coerced to undefined, so the AWS update command omitted
the field and the previous value survived — there was no way to remove a
function's layers, detach it from a VPC, or drop event source filters,
response types, and source access configurations.

A blank field still means "leave unchanged", since treating it as "clear"
would wipe the setting on every update that left it empty. Clearing is now
an explicit empty-array literal, documented in each field's description and
placeholder.

Also stops toSourceAccessConfigurations from folding an empty list back into
an omitted field.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

Comment thread apps/sim/blocks/blocks/lambda.ts
…dline

The `timeout` param name is reserved: the shared tool executor reads
`params.timeout` as its own operation deadline in milliseconds. A Lambda
function timeout of 30 seconds therefore aborted the call after 30ms, so
Create Function and Update Function Configuration failed whenever a timeout
was set. Renamed to `functionTimeout`.

Also tightens the boundary against documented AWS constraints and drops
avoidable provider round-trips:

- optional params supplied as null or an empty string are omitted rather than
  forwarded, so an empty qualifier no longer reaches AWS as `Qualifier: ''`
- documented limits on functionName, qualifier, clientContext, statementId,
  action, and alias routing weights
- source access configuration types are a closed enum, excluding VIRTUAL_HOST
  on update where AWS rejects it
- cross-field checks: exactly one code source matched to packageType, runtime
  and handler required for a .zip package, an event source or Kafka bootstrap
  servers required, AT_TIMESTAMP paired with its timestamp, and masterRegion
  only alongside functionVersion ALL
- architectures takes exactly one value, so it is no longer clearable
- the block declares AuthMode.ApiKey, correcting a catalog entry that
  advertised the integration as needing no authentication

Removes the unreachable non-ok branch from every transformResponse: the shared
executor throws on any non-ok response before transformResponse runs.

Raises the internal tool-operation registry test budget, whose cost scales with
the number of registered tools.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

Clearing only one of the two VPC lists produced `VpcConfig: { SubnetIds: [] }`
with no security groups, because an empty array is truthy and the wrapper
included each list independently. That is not a detach — it is an invalid
partial attachment.

A Lambda VPC attachment is a unit, so the contract now requires the two lists
to be supplied together on Create Function and Update Function Configuration,
naming the missing side. The wrapper defaults the other list to empty as well,
so it cannot emit a one-sided config even if called directly.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Confirmed and fixed in ec9d37e — this was a real follow-on from the previous round, not a stale read.

The counterexample was exact: an empty array is truthy, so toVpcConfig([], undefined) fell past the if (!subnetIds && !securityGroupIds) guard and then included each list independently, emitting VpcConfig: { SubnetIds: [] } with no security groups. Once the previous round made clearing possible at all, that one-sided path became reachable.

A Lambda VPC attachment is a unit, so the fix is at both levels:

  • The contract now requires vpcSubnetIds and vpcSecurityGroupIds to be supplied together on Create Function and Update Function Configuration, reporting on whichever side is missing.
  • toVpcConfig defaults the other list to [], so it cannot emit a one-sided config even if called directly.

Covered by four tests: a one-sided update is rejected at the boundary, a both-empty detach is accepted, and the mapper emits both keys in each direction.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile-apps

@waleedlatif1
waleedlatif1 merged commit cb28b11 into staging Aug 28, 2026
29 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/aws-lambda-integration branch August 28, 2026 17:26
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