Install
$ agentstack add skill-giuseppe-trisciuoglio-developer-kit-aws-lambda-java-integration ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
AWS Lambda Java Integration
Patterns for creating high-performance AWS Lambda functions in Java with optimized cold starts.
Overview
This skill provides complete patterns for AWS Lambda Java development, covering two main approaches:
- Micronaut Framework - Full-featured framework with AOT compilation, dependency injection, and cold start {
private final MyService service;
public MyFunction(MyService service) { this.service = service; }
@Override public APIGatewayProxyResponseEvent apply(APIGatewayProxyRequestEvent request) { // Process request return new APIGatewayProxyResponseEvent() .withStatusCode(200) .withBody("{\"message\": \"Success\"}"); } }
#### Raw Java Handler
```java
public class MyHandler implements RequestHandler {
private static final MyService service = new MyService();
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context) {
return new APIGatewayProxyResponseEvent()
.withStatusCode(200)
.withBody("{\"message\": \"Success\"}");
}
}
Validate: Run sam local invoke to verify handler works before deployment.
Core Patterns
Connection Management
// Initialize once, reuse across invocations
private static final DynamoDbClient dynamoDb = DynamoDbClient.builder()
.region(Region.US_EAST_1)
.build();
// Avoid: Creating clients in handler (slow on every invocation)
Error Handling
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent request, Context context) {
try {
return successResponse(process(request));
} catch (ValidationException e) {
return errorResponse(400, e.getMessage());
} catch (Exception e) {
context.getLogger().log("Error: " + e.getMessage());
return errorResponse(500, "Internal error");
}
}
Best Practices
Configuration
- Memory: Start with 512MB, adjust based on profiling
- Timeout: Micronaut 10-30s, Raw Java 5-10s
- Runtime: Java 17 or 21 for best performance
Packaging
- Use Gradle Shadow Plugin or Maven Shade Plugin
- Exclude unnecessary dependencies
Monitoring
- Enable X-Ray tracing for performance analysis
- Use CloudWatch Insights to track cold vs warm starts
Deployment Options
Serverless Framework
service: my-java-lambda
provider:
name: aws
runtime: java21
memorySize: 512
timeout: 10
package:
artifact: build/libs/function.jar
functions:
api:
handler: com.example.Handler
events:
- http:
path: /{proxy+}
method: ANY
Validate: Run serverless deploy with --stage dev first.
AWS SAM
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: build/libs/function.jar
Handler: com.example.Handler
Runtime: java21
MemorySize: 512
Timeout: 10
Events:
ApiEvent:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
Validate: Run sam validate before deploying.
Constraints and Warnings
Java-Specific Constraints
- Reflection: Minimize use; prefer AOT compilation (Micronaut)
- Classpath scanning: Slows cold start; use explicit configuration
- Large frameworks: Spring Boot adds significant cold start overhead
Common Pitfalls
- Initialization in handler - Causes repeated work on warm invocations
- Oversized JARs - Include only required dependencies
- Insufficient memory - Java needs more memory than Node.js/Python
- No timeout handling - Always set appropriate timeouts
References
For detailed guidance on specific topics:
- [Micronaut Lambda](references/micronaut-lambda.md) - Complete Micronaut setup, AOT configuration, DI optimization
- [Raw Java Lambda](references/raw-java-lambda.md) - Minimal handler patterns, singleton caching, JAR packaging
- [Serverless Deployment](references/serverless-deployment.md) - Serverless Framework, SAM, CI/CD pipelines, provisioned concurrency
- [Testing Lambda](references/testing-lambda.md) - JUnit 5, SAM Local, integration testing, performance measurement
Examples
Example 1: Create a Micronaut Lambda Function
Input:
Create a Java Lambda function using Micronaut to handle user REST API
Process:
- Configure Gradle project with Micronaut plugin
- Create Handler class extending MicronautRequestHandler
- Implement methods for GET/POST/PUT/DELETE
- Configure application.yml with AOT optimizations
- Set up packaging with Shadow plugin
- Validate: Test locally with SAM CLI before deploying
Output:
- Complete project structure
- Handler with dependency injection
- serverless.yml deployment configuration
Example 2: Optimize Cold Start for Raw Java
Input:
My Java Lambda has 3 second cold start, how do I optimize it?
Process:
- Analyze initialization code
- Move AWS client creation to static fields
- Reduce dependencies in build.gradle
- Configure optimized JVM options
- Consider provisioned concurrency
- Validate: Measure cold start with CloudWatch metrics after changes
Output:
- Refactored code with singleton pattern
- Minimized JAR
- Cold start < 500ms
Example 3: Deploy with GitHub Actions
Input:
Configure CI/CD for Java Lambda with SAM
Process:
- Create GitHub Actions workflow
- Configure Gradle build with Shadow
- Set up SAM build and deploy
- Add test stage before deployment
- Configure environment protection for prod
Output:
- Complete .github/workflows/deploy.yml
- Multi-stage pipeline (dev/staging/prod)
- Integrated test automation
Version
Version: 1.0.0
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: giuseppe-trisciuoglio
- Source: giuseppe-trisciuoglio/developer-kit
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.