1. AmazonWebServices
Amazon Web Services module for aws-sdk-java 2.x
1.1. Usage
1) Add the dependency:
Maven
Gradle
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-awssdk-v2</artifactId>
<version>1.12.777</version>
</dependency>
2) Add required service dependency (S3 here):
Maven
Gradle
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version></version>
</dependency>
3) Add the aws.accessKeyId
and aws.secretKey
properties:
application.conf
aws.accessKeyId = "your access key id"
aws.secretKey = "your secret key"
This step is optional if you choose one of the default credentials mechanism.
4) Install
Java
Kotlin
import io.jooby.awssdkv2.AwsModule;
{
install(
new AwsModule() (1)
.setup(credentials -> { (2)
var s3 = S3Client.builder().build();
var s3transfer = S3TransferManager.builder().s3Client(s3).build();
return Stream.of(s3, s3transfer);
})
)
);
}
1 | Install module |
2 | Setup one or more services |
Services created from setup function are:
-
Registered in the application service registry, for require call usage or DI framework
-
Services are shutdown at application shutdown time