public class AwsModule extends Object implements Extension
{
install(
new AwsModule()
.setup(credentials -> {
return TransferManagerBuilder.standard()
.withS3Client(
AmazonS3ClientBuilder.standard()
.withRegion(Regions.US_EAST_1)
.withCredentials(credentials)
.build()
).build();
})
);
}
Previous example register AmazonS3Client and TransferManager services
NOTE: You need to add the required service dependency to your project.
| Constructor and Description |
|---|
AwsModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
install(Jooby application) |
static com.amazonaws.auth.AWSCredentialsProvider |
newCredentialsProvider(com.typesafe.config.Config config)
Creates a credentials provider, exactly like
DefaultAWSCredentialsProviderChain appending the application
properties provider. |
AwsModule |
setup(Function<com.amazonaws.auth.AWSCredentialsProvider,Object> provider)
Setup a new AWS service.
|
@Nonnull public AwsModule setup(@Nonnull Function<com.amazonaws.auth.AWSCredentialsProvider,Object> provider)
provider - Service provider/factory.@Nonnull public static com.amazonaws.auth.AWSCredentialsProvider newCredentialsProvider(@Nonnull com.typesafe.config.Config config)
DefaultAWSCredentialsProviderChain appending the application
properties provider.config - Application properties.Copyright © 2023. All rights reserved.