Done ticket GEPAFINBE-8
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package net.gepafin.tendermanagement.config;
|
||||
|
||||
import com.amazonaws.auth.AWSCredentials;
|
||||
import com.amazonaws.auth.AWSStaticCredentialsProvider;
|
||||
import com.amazonaws.auth.BasicAWSCredentials;
|
||||
import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class AmazonConfig {
|
||||
|
||||
@Value("${aws.access.key.id}")
|
||||
private String accessKey;
|
||||
|
||||
@Value("${aws.secret.access.key}")
|
||||
private String secretKey;
|
||||
|
||||
@Value("${aws.s3.region}")
|
||||
private String region;
|
||||
|
||||
@Bean
|
||||
public AmazonS3 mementoBucket() {
|
||||
AWSCredentials awsCredentials =
|
||||
new BasicAWSCredentials(accessKey, secretKey);
|
||||
return AmazonS3ClientBuilder
|
||||
.standard()
|
||||
.withRegion(region)
|
||||
.withCredentials(new AWSStaticCredentialsProvider(awsCredentials))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user