Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides AWS Lambda patterns using AWS SDK for Java 2.x. Use when invoking Lambda functions, creating/updating functions, managing function configurations, working with Lambda layers, or integrating Lambda with Spring Boot applications.
.claude/skills/giuseppe-trisciuoglio-aws-sdk-java-v2-lambda/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-18 | ✓→✓ | = Same ✓ | 289% | 0% |
| case-13 | ✓→✓ | = Same ✓ | 158% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 85% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 116% | 0% |
AWS Lambda is a compute service that runs code without managing servers. Use this skill to implement AWS Lambda operations using AWS SDK for Java 2.x in applications and services.
| Operation | SDK Method | Use Case | |-----------|------------|----------| | Invoke | invoke() | Synchronous/async function invocation | | List Functions | listFunctions() | Get all Lambda functions | | Get Config | getFunction() | Retrieve function configuration | | Create Function | createFunction() | Create new Lambda function | | Update Code | updateFunctionCode() | Deploy new function code | | Update Config | updateFunctionConfiguration() | Modify settings (timeout, memory, env vars) | | Delete Function | deleteFunction() | Remove Lambda function |
Include Lambda SDK dependency in pom.xml:
xml<dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>lambda</artifactId> </dependency>
See client-setup.md for complete setup.
Instantiate LambdaClient with proper configuration:
javaLambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .build();
For async operations, use LambdaAsyncClient.
Synchronous invocation:
javaInvokeRequest request = InvokeRequest.builder() .functionName("my-function") .payload(SdkBytes.fromUtf8String(payload)) .build(); InvokeResponse response = lambdaClient.invoke(request); return response.payload().asUtf8String();
See invocation-patterns.md for patterns.
Parse response payloads and check for errors:
javaif (response.functionError() != null) { throw new LambdaInvocationException("Lambda error: " + response.functionError()); } String result = response.payload().asUtf8String();
Create, update, or delete Lambda functions:
java// Create CreateFunctionRequest createRequest = CreateFunctionRequest.builder() .functionName("my-function") .runtime(Runtime.JAVA17) .role(roleArn) .code(code) .build(); lambdaClient.createFunction(createRequest); // Verify function is active before proceeding GetFunctionRequest getRequest = GetFunctionRequest.builder() .functionName("my-function") .build(); GetFunctionResponse getResponse = lambdaClient.getFunction(getRequest); if (!"Active".equals(getResponse.configuration().state())) { throw new IllegalStateException("Function not active: " + getResponse.configuration().stateReason()); } // Update code UpdateFunctionCodeRequest updateCodeRequest = UpdateFunctionCodeRequest.builder() .functionName("my-function") .zipFile(SdkBytes.fromByteArray(zipBytes)) .build(); lambdaClient.updateFunctionCode(updateCodeRequest); // Wait for deployment to complete Waiter<GetFunctionConfigurationRequest> waiter = lambdaClient.waiter(); waiter.waitUntilFunctionUpdatedActive(GetFunctionConfigurationRequest.builder() .functionName("my-function") .build());
See function-management.md for complete patterns.
Set environment variables and concurrency limits:
javaEnvironment env = Environment.builder() .variables(Map.of( "DB_URL", "jdbc:postgresql://db", "LOG_LEVEL", "INFO" )) .build(); UpdateFunctionConfigurationRequest configRequest = UpdateFunctionConfigurationRequest.builder() .functionName("my-function") .environment(env) .timeout(60) .memorySize(512) .build(); lambdaClient.updateFunctionConfiguration(configRequest);
Configure Lambda beans and services:
java@Configuration public class LambdaConfiguration { @Bean public LambdaClient lambdaClient() { return LambdaClient.builder() .region(Region.US_EAST_1) .build(); } } @Service public class LambdaInvokerService { public <T, R> R invoke(String functionName, T request, Class<R> responseType) { // Implementation } }
See spring-boot-integration.md for complete integration.
Use mocks or LocalStack for development testing.
See testing.md for testing patterns.
javapublic String invokeFunction(LambdaClient client, String functionName, String payload) { InvokeRequest request = InvokeRequest.builder() .functionName(functionName) .payload(SdkBytes.fromUtf8String(payload)) .build(); InvokeResponse response = client.invoke(request); if (response.functionError() != null) { throw new RuntimeException("Lambda error: " + response.functionError()); } return response.payload().asUtf8String(); }
javapublic void invokeAsync(LambdaClient client, String functionName, Map<String, Object> event) { String jsonPayload = new ObjectMapper().writeValueAsString(event); InvokeRequest request = InvokeRequest.builder() .functionName(functionName) .invocationType(InvocationType.EVENT) .payload(SdkBytes.fromUtf8String(jsonPayload)) .build(); client.invoke(request); }
java@Service public class LambdaService { private final LambdaClient lambdaClient; public UserResponse processUser(UserRequest request) { String payload = objectMapper.writeValueAsString(request); InvokeResponse response = lambdaClient.invoke( InvokeRequest.builder() .functionName("user-processor") .payload(SdkBytes.fromUtf8String(payload)) .build() ); return objectMapper.readValue( response.payload().asUtf8String(), UserResponse.class ); } }
See examples.md for more examples.
LambdaClient/LambdaAsyncClient once; they are thread-safeLambdaAsyncClient with CompletableFutureActive after create/update operationsRuntime.JAVA17 or newer for improved cold start performanceaws-sdk-java-v2-core — Core AWS SDK patterns and client configurationspring-boot-dependency-injection — Spring dependency injection best practicesunit-test-service-layer — Service testing patterns with Mockitospring-boot-actuator — Production monitoring and health checks| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-18 | pass→pass | 3,813 | 3,753 | -2% | 1 | 1 | 0% | 720 | 2,800 | +289% | 0 | 0 | — |
case-13 | pass→pass | 6,352 | 4,432 | -30% | 1 | 1 | 0% | 1,159 | 2,995 | +158% | 0 | 0 | — |
case-01 | pass→pass | 8,692 | 3,800 | -56% | 1 | 1 | 0% | 1,589 | 2,933 | +85% | 0 | 0 | — |
case-02 | pass→pass | 9,509 | 8,593 | -10% | 1 | 1 | 0% | 1,714 | 3,698 | +116% | 0 | 0 | — |
case-03 | pass→pass | 4,575 | 3,969 | -13% | 1 | 1 | 0% | 857 | 2,989 | +249% | 0 | 0 | — |
case-04 | pass→pass | 3,146 | 2,042 | -35% | 1 | 1 | 0% | 584 | 2,526 | +333% | 0 | 0 | — |
case-05 | pass→pass | 7,543 | 4,012 | -47% | 1 | 1 | 0% | 1,214 | 2,781 | +129% | 0 | 0 | — |
case-06 | pass→pass | 4,228 | 3,690 | -13% | 1 | 1 | 0% | 645 | 2,700 | +319% | 0 | 0 | — |
case-07 | pass→pass | 2,827 | 1,804 | -36% | 1 | 1 | 0% | 398 | 2,468 | +520% | 0 | 0 | — |
case-08 | pass→pass | 5,530 | 3,767 | -32% | 1 | 1 | 0% | 793 | 2,815 | +255% | 0 | 0 | — |
case-09 | fail→pass | 8,626 | 3,613 | -58% | 1 | 1 | 0% | 1,604 | 2,853 | +78% | 0 | 0 | — |
case-10 | pass→pass | 12,771 | 10,148 | -21% | 1 | 1 | 0% | 2,202 | 4,009 | +82% | 0 | 0 | — |
case-11 | pass→pass | 2,676 | 2,145 | -20% | 1 | 1 | 0% | 434 | 2,491 | +474% | 0 | 0 | — |
case-12 | pass→pass | 11,531 | 11,854 | +3% | 1 | 1 | 0% | 1,973 | 3,731 | +89% | 0 | 0 | — |
case-14 | pass→pass | 6,260 | 5,089 | -19% | 1 | 1 | 0% | 1,111 | 2,991 | +169% | 0 | 0 | — |
case-15 | pass→pass | 4,679 | 2,927 | -37% | 1 | 1 | 0% | 682 | 2,596 | +281% | 0 | 0 | — |
case-16 | pass→pass | 9,204 | 4,199 | -54% | 1 | 1 | 0% | 1,545 | 2,809 | +82% | 0 | 0 | — |
case-17 | pass→pass | 9,985 | 6,125 | -39% | 1 | 1 | 0% | 1,637 | 3,210 | +96% | 0 | 0 | — |
case-19 | pass→pass | 8,674 | 5,772 | -33% | 1 | 1 | 0% | 1,608 | 3,162 | +97% | 0 | 0 | — |
case-20 | pass→pass | 12,085 | 7,438 | -38% | 1 | 1 | 0% | 2,418 | 3,690 | +53% | 0 | 0 | — |
case-21 | pass→pass | 14,843 | 9,815 | -34% | 1 | 1 | 0% | 2,906 | 4,015 | +38% | 0 | 0 | — |
case-22 | pass→pass | 7,914 | 7,511 | -5% | 1 | 1 | 0% | 1,365 | 3,386 | +148% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.