feat(lambda): add AWS Lambda integration with 50 operations - #7216
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe 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.
Confidence Score: 5/5The 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.
|
| 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
Reviews (5): Last reviewed commit: "fix(lambda): never send a half-configure..." | Re-trigger Greptile
There was a problem hiding this comment.
Review completed against the latest diff
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
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.
…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.
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.
|
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 A Lambda VPC attachment is a unit, so the fix is at both levels:
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. |
Summary
@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.zipupload is not supported, and the docs page says soType of Change
Testing
bun run type-checkclean; all 38check:auditspass, includingcheck:api-validation:strict,docs:check,integration-catalog:check,check:tool-request-boundary, andcheck:bare-iconsChecklist