
Aws Sdk Java V2 Lambda
Configure AWS SDK for Java v2 Lambda clients—sync, async, HTTP timeouts, and credentials—for serverless handlers and Spring Boot services.
Overview
aws-sdk-java-v2-lambda is an agent skill for the Build phase that documents AWS SDK for Java v2 Lambda client setup, async variants, HTTP tuning, and credentials.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-sdk-java-v2-lambdaWhat is this skill?
- Maven dependency snippet for software.amazon.awssdk lambda artifact
- Synchronous LambdaClient and asynchronous LambdaAsyncClient builder examples
- Apache HTTP client timeouts—5s connection and 300s socket—for long invokes
- StaticCredentialsProvider pattern for local or CI credential injection
- Spring Boot section for wiring clients in JVM backends
- Documents 300-second socket timeout example
- Covers both synchronous and asynchronous client variants
Adoption & trust: 1.1k installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a correct Java v2 LambdaClient configuration with Maven deps, regions, and timeouts but only find fragmented AWS docs.
Who is it for?
Java backend developers invoking Lambda from ECS, Spring Boot, or batch jobs who standardize on AWS SDK v2.
Skip if: Node or Python Lambda authoring, Terraform-only deploys, or teams needing full IAM policy design without Java client code.
When should I use this skill?
Setting up or debugging AWS SDK for Java v2 Lambda clients in Maven or Spring Boot projects.
What do I get? / Deliverables
You copy vetted builder patterns for sync and async Lambda clients ready to plug into handlers or Spring Boot services.
- LambdaClient and LambdaAsyncClient builder code
- Maven dependency block
- HTTP timeout configuration snippet
Recommended Skills
Journey fit
Build integrations is the natural shelf because the skill is client bootstrap and dependency wiring before deploy and operate tuning. Integrations fits Lambda SDK setup as the glue between your Java service code and AWS invoke APIs, not frontend or pure infra runbooks.
How it compares
Skill package for JVM Lambda *callers*, not a CDK deploy generator or a generic AWS CLI cheat sheet.
Common Questions / FAQ
Who is aws-sdk-java-v2-lambda for?
Indie and solo builders on Java or Spring Boot who call AWS Lambda from application code and want SDK v2 snippets an agent can apply directly.
When should I use aws-sdk-java-v2-lambda?
During Build integrations when adding Maven dependencies, choosing sync vs async clients, or fixing invoke timeouts before you ship to staging.
Is aws-sdk-java-v2-lambda safe to install?
Check the Security Audits panel on this page; never commit real access keys—use roles or environment secrets the skill illustrates only as placeholders.
SKILL.md
READMESKILL.md - Aws Sdk Java V2 Lambda
# Lambda Client Setup ## Maven Dependency ```xml <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>lambda</artifactId> </dependency> ``` ## Basic Client Configuration ### Synchronous Client ```java import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.lambda.LambdaClient; LambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .build(); ``` ### Asynchronous Client ```java import software.amazon.awssdk.services.lambda.LambdaAsyncClient; LambdaAsyncClient asyncLambdaClient = LambdaAsyncClient.builder() .region(Region.US_EAST_1) .build(); ``` ### Custom Configuration ```java import software.amazon.awssdk.http.apache.ApacheHttpClient; import java.time.Duration; LambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .httpClientBuilder(ApacheHttpClient.builder() .connectionTimeout(Duration.ofSeconds(5)) .socketTimeout(Duration.ofSeconds(300))) .build(); ``` ### With Credentials Provider ```java import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; AwsBasicCredentials credentials = AwsBasicCredentials.create( "access-key-id", "secret-access-key" ); LambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .credentialsProvider(StaticCredentialsProvider.create(credentials)) .build(); ``` ## Spring Boot Configuration ```java import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class LambdaConfiguration { @Bean public LambdaClient lambdaClient() { return LambdaClient.builder() .region(Region.US_EAST_1) .build(); } @Bean public LambdaAsyncClient lambdaAsyncClient() { return LambdaAsyncClient.builder() .region(Region.US_EAST_1) .build(); } } ``` ## Environment-Specific Configuration ```java @Bean public LambdaClient lambdaClient( @Value("${aws.region}") String region, @Value("${aws.endpoint}") Optional<String> endpoint ) { LambdaClient.Builder builder = LambdaClient.builder() .region(Region.of(region)); endpoint.ifPresent(e -> builder.endpointOverride(URI.create(e))); return builder.build(); } ``` # AWS Lambda Java SDK Examples ## Client Setup ### Basic Client Configuration ```java import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.lambda.LambdaClient; // Create synchronous client LambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .build(); // Create asynchronous client LambdaAsyncClient asyncLambdaClient = LambdaAsyncClient.builder() .region(Region.US_EAST_1) .build(); ``` ### Client with Configuration ```java import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; import software.amazon.awssdk.http.nio.netty.NettyNioHttpServer; LambdaClient lambdaClient = LambdaClient.builder() .region(Region.US_EAST_1) .credentialsProvider(DefaultCredentialsProvider.create()) .httpClientBuilder(NettyNioHttpServer.builder()) .build(); ``` ## Function Invocation Examples ### Synchronous Invocation with String Payload ```java import software.amazon.awssdk.services.lambda.model.*; import software.amazon.awssdk.core.SdkBytes; public String invokeLambdaSync(LambdaClient lambdaClient, String functionName, String payload) { InvokeRequest request = InvokeRequest.builder() .functionName(functionName) .payload(SdkBytes.fromUtf8String(payload)) .build(); InvokeResponse response = lambdaClient.invoke(request); // Check for function errors if (response.functionError() != null) { throw new RuntimeException("Lambda function error: " + response.pa