or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

common-patterns.mdcore-sdk.mddynamodb-service.mdindex.mds3-service.md
tile.json

This tile was archived by the owner on Nov 21, 2025

Reason: low quality / incomplete tile

tessl/maven-com-amazonaws--aws-java-sdk

The AWS SDK for Java 1.x enables Java developers to easily work with Amazon Web Services and build scalable solutions

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/com.amazonaws/aws-java-sdk@1.12.x

To install, run

npx @tessl/cli install tessl/maven-com-amazonaws--aws-java-sdk@1.12.1

index.mddocs/

AWS SDK for Java 1.x

The AWS SDK for Java 1.x is a comprehensive library that enables Java developers to easily work with Amazon Web Services and build scalable solutions. It provides Java APIs for over 370 AWS services including Amazon S3, Amazon DynamoDB, Amazon EC2, AWS Lambda, and hundreds more.

Important: This SDK is in maintenance mode as of July 31, 2024 and will reach end-of-support on December 31, 2025. AWS recommends migrating to the AWS SDK for Java 2.x for continued support and new features.

Package Information

  • Package Name: aws-java-sdk
  • Package Type: maven
  • Group ID: com.amazonaws
  • Language: Java
  • Minimum Java Version: Java 8+
  • License: Apache 2.0
  • Version: 1.12.793
  • Status: Maintenance mode (end-of-support: December 31, 2025)
  • Migration Path: AWS SDK for Java 2.x (software.amazon.awssdk)

Installation

Using Maven with BOM (Recommended)

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-bom</artifactId>
      <version>1.12.793</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

<dependencies>
  <!-- Include only the services you need -->
  <dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-s3</artifactId>
  </dependency>
  <dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-dynamodb</artifactId>
  </dependency>
</dependencies>

Using Gradle

dependencies {
    implementation platform('com.amazonaws:aws-java-sdk-bom:1.12.793')
    implementation 'com.amazonaws:aws-java-sdk-s3'
    implementation 'com.amazonaws:aws-java-sdk-dynamodb'
}

Core Imports

// Core SDK classes
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.regions.Regions;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;

// Service-specific imports (example: S3)
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.*;

// Service-specific imports (example: DynamoDB)
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
import com.amazonaws.services.dynamodbv2.model.*;

Basic Usage

Creating a Service Client

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;

// Create S3 client with default configuration
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
    .withRegion(Regions.US_WEST_2)
    .withCredentials(new DefaultAWSCredentialsProviderChain())
    .build();

// Use the client
s3Client.listBuckets().forEach(bucket -> {
    System.out.println("Bucket: " + bucket.getName());
});

Working with Credentials

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;

// Recommended: Use default credential provider chain
// Automatically searches: env vars -> system properties -> profile -> IAM role
DefaultAWSCredentialsProviderChain credentialsProvider =
    new DefaultAWSCredentialsProviderChain();

// For development/testing: Static credentials
AWSStaticCredentialsProvider staticCreds = new AWSStaticCredentialsProvider(
    new BasicAWSCredentials("accessKey", "secretKey")
);

Exception Handling

import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;

try {
    s3Client.getObject("my-bucket", "my-key");
} catch (AmazonServiceException ase) {
    // Service-side error (4xx, 5xx HTTP status)
    System.err.println("Error Code: " + ase.getErrorCode());
    System.err.println("HTTP Status: " + ase.getStatusCode());
    System.err.println("Request ID: " + ase.getRequestId());
} catch (SdkClientException sce) {
    // Client-side error (network failure, etc.)
    System.err.println("Client error: " + sce.getMessage());
}

Architecture

The AWS SDK for Java 1.x is organized as a modular Maven-based monorepo containing 371+ service modules. Each AWS service follows a consistent architectural pattern, making it easy to work with any service once you understand the core concepts.

Module Organization

Service Module Naming: aws-java-sdk-{service-name}

  • Examples: aws-java-sdk-s3, aws-java-sdk-dynamodb, aws-java-sdk-ec2

Package Structure: com.amazonaws.services.{service-name}

Standard Classes Per Service:

  • Service Interface: Amazon{Service} or AWS{Service} (e.g., AmazonS3, AmazonDynamoDB)
  • Service Client: {Interface}Client (e.g., AmazonS3Client)
  • Client Builder: {Interface}ClientBuilder (e.g., AmazonS3ClientBuilder)
  • Async Interface: {Interface}Async (optional, for async operations)
  • Model Package: model.* containing request/result objects and domain models

Key Design Patterns

  1. Builder Pattern: All service clients use fluent builders for configuration
  2. Request/Response Pattern: Every operation uses typed request and result objects
  3. Thread-Safe Clients: Client instances are thread-safe and should be reused
  4. Credential Provider Chain: Flexible credential resolution from multiple sources
  5. Consistent Exception Handling: AmazonServiceException for service errors, SdkClientException for client errors

Capabilities

Core SDK Features

Fundamental APIs and patterns used across all AWS services, including authentication, credential management, client builders, region configuration, and exception handling.

// Credential providers
interface AWSCredentialsProvider {
    AWSCredentials getCredentials();
    void refresh();
}

// Default credential chain
class DefaultAWSCredentialsProviderChain extends AWSCredentialsProviderChain {
    static DefaultAWSCredentialsProviderChain getInstance();
}

// Client builder base
abstract class AwsClientBuilder<Subclass, TypeToBuild> {
    Subclass withRegion(Regions region);
    Subclass withRegion(String region);
    Subclass withCredentials(AWSCredentialsProvider credentialsProvider);
    Subclass withClientConfiguration(ClientConfiguration config);
    TypeToBuild build();
}

// Exception hierarchy
class AmazonServiceException extends SdkClientException {
    String getErrorCode();
    int getStatusCode();
    String getRequestId();
}

Core SDK APIs

Amazon S3 APIs

Complete API for Amazon Simple Storage Service (S3), including bucket operations, object operations, multipart uploads, pre-signed URLs, access control, and the high-level Transfer Manager for efficient large file transfers.

// S3 client builder
class AmazonS3ClientBuilder extends AwsSyncClientBuilder<AmazonS3ClientBuilder, AmazonS3> {
    static AmazonS3ClientBuilder standard();
    static AmazonS3 defaultClient();
}

// Main S3 interface
interface AmazonS3 {
    // Bucket operations
    Bucket createBucket(String bucketName);
    void deleteBucket(String bucketName);
    List<Bucket> listBuckets();

    // Object operations
    PutObjectResult putObject(String bucketName, String key, File file);
    S3Object getObject(String bucketName, String key);
    void deleteObject(String bucketName, String key);
    ObjectListing listObjects(String bucketName);

    // Pre-signed URLs
    URL generatePresignedUrl(String bucketName, String key, Date expiration);
}

S3 Service APIs

Amazon DynamoDB APIs

Complete API for Amazon DynamoDB, including three levels of abstraction: low-level service client for direct table and item operations, Document API for simplified item handling, and Object Mapper for ORM-style POJO mapping with annotations.

// DynamoDB client builder
class AmazonDynamoDBClientBuilder extends AwsSyncClientBuilder<AmazonDynamoDBClientBuilder, AmazonDynamoDB> {
    static AmazonDynamoDBClientBuilder standard();
    static AmazonDynamoDB defaultClient();
}

// Low-level DynamoDB interface
interface AmazonDynamoDB {
    PutItemResult putItem(String tableName, Map<String, AttributeValue> item);
    GetItemResult getItem(String tableName, Map<String, AttributeValue> key);
    QueryResult query(QueryRequest queryRequest);
    ScanResult scan(ScanRequest scanRequest);
}

// Document API
class DynamoDB {
    DynamoDB(AmazonDynamoDB client);
    Table getTable(String tableName);
}

// Object Mapper
class DynamoDBMapper {
    DynamoDBMapper(AmazonDynamoDB dynamoDB);
    <T> T load(Class<T> clazz, Object hashKey);
    <T> void save(T object);
    <T> PaginatedQueryList<T> query(Class<T> clazz, DynamoDBQueryExpression<T> queryExpression);
}

DynamoDB Service APIs

Common Patterns

Essential patterns used across all AWS services including client creation, credential configuration, pagination, async operations, exception handling, waiters, and batch operations.

// Standard client creation pattern
AmazonS3 client = AmazonS3ClientBuilder.standard()
    .withRegion(Regions.US_WEST_2)
    .withCredentials(new DefaultAWSCredentialsProviderChain())
    .build();

// Pagination pattern for list operations
ListObjectsV2Request request = new ListObjectsV2Request()
    .withBucketName(bucketName)
    .withMaxKeys(1000);

ListObjectsV2Result result;
do {
    result = s3.listObjectsV2(request);
    // Process results
    request.setContinuationToken(result.getNextContinuationToken());
} while (result.isTruncated());

// Async operations with callback
asyncClient.putItemAsync(request, new AsyncHandler<PutItemRequest, PutItemResult>() {
    public void onSuccess(PutItemRequest req, PutItemResult result) { }
    public void onError(Exception exception) { }
});

// Waiter pattern for polling resource state
ec2.waiters().instanceRunning().run(
    new WaiterParameters<>(new DescribeInstancesRequest().withInstanceIds(instanceId))
);

Common Patterns

Other AWS Services

The SDK includes support for 371+ AWS services. While this documentation focuses on the most commonly used services (S3 and DynamoDB), all services follow the same architectural patterns:

Major Service Categories:

  • Compute: EC2, Lambda, ECS, EKS, Batch, Elastic Beanstalk
  • Storage: S3, Glacier, EFS, FSx, Storage Gateway
  • Database: DynamoDB, RDS, Redshift, Neptune, DocumentDB, ElastiCache
  • Networking: ELB, ALB/NLB, Route 53, API Gateway, Direct Connect
  • Messaging: SQS, SNS, Kinesis, EventBridge, MQ
  • Security: IAM, STS, Cognito, Secrets Manager, KMS, ACM
  • AI/ML: Bedrock, SageMaker, Rekognition, Comprehend, Translate
  • Developer Tools: CodeCommit, CodeBuild, CodeDeploy, CodePipeline
  • Management: CloudFormation, CloudWatch, CloudTrail, Config

Each service module follows the pattern: aws-java-sdk-{service-name} with consistent client builder and interface patterns.

Migration Information

Maintenance Mode: As of July 31, 2024, the AWS SDK for Java 1.x is in maintenance mode. It will reach end-of-support on December 31, 2025.

Recommended Action: Migrate to the AWS SDK for Java 2.x

  • Package namespace: software.amazon.awssdk
  • Improved performance with non-blocking I/O
  • Better start-up performance
  • Automatic pagination support
  • Continued AWS support and new features

Migration Guide: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration.html

Additional Resources