Skip to content

Starter S3

This library provides features for dealing with the Amazon S3 file storage.

Based on: - io.awspring.cloud:spring-cloud-aws-core

The configuration class contains two beans, namely:

  • AmazonS3Client: Providing an interface for accessing the S3 object storage.
  • S3BucketRepository: Providing an abstraction for s3 client with simple repository methods.

Configuration

The following properties are needed for the configuration.

Property Description Example Env
s3.bucketName string The name of the bucket containing the desired object. myphotos S3_BUCKET_NAME
s3.endpoint string The endpoint either with or without the protocol https://s3.eu-west-1.amazonaws.com or s3.eu-west-1.amazonaws.com S3_ENDPOINT
s3.region string The region to use for SigV4 signing of requests eu-west-1 S3_REGION
s3.secretKey string The AWS secret access key s3cret S3_SECRET_KEY
s3.accessKey string The AWS access key s3cretAccess S3_ACCESS_KEY
management.health.s3.enabled boolean Flag to enable s3 health check. true MANAGEMENT_HEALTH_S3_ENABLED

Testing

We recommend to use Robothy's local-s3 JUnit 5 extension for testing.