@Profile(value="s3")
@Configuration
public class AwsS3Config
extends java.lang.Object
Constructor and Description |
---|
AwsS3Config() |
Modifier and Type | Method and Description |
---|---|
com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider |
awsCredentialsFromFile(java.lang.String credentialsFilePath)
Create the credentials needed for the application to be able to connect to Aws.
|
com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider |
awsCredentialsProvider(java.lang.String roleArn)
Assume role credentials provider which will be used to fetch session credentials.
|
com.amazonaws.services.s3.AmazonS3Client |
genieS3Client(int noOfS3Retries,
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)
A bean providing a client to work with S3.
|
FileTransfer |
s3FileTransferImpl(com.amazonaws.services.s3.AmazonS3Client s3Client,
com.netflix.spectator.api.Registry registry)
Returns a bean which has an s3 implementation of the File Transfer interface.
|
@Bean @ConditionalOnProperty(value="genie.aws.credentials.file") public com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider awsCredentialsFromFile(@Value(value="${genie.aws.credentials.file}") java.lang.String credentialsFilePath)
credentialsFilePath
- The path of the file containing aws credentials@Bean @ConditionalOnProperty(value="genie.aws.credentials.role") public com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider awsCredentialsProvider(@Value(value="${genie.aws.credentials.role}") java.lang.String roleArn)
roleArn
- Arn of the IAM role@Bean @ConditionalOnBean(value=com.amazonaws.auth.AWSCredentialsProvider.class) public com.amazonaws.services.s3.AmazonS3Client genieS3Client(@Value(value="${genie.retry.s3.noOfRetries:5}") int noOfS3Retries, com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)
noOfS3Retries
- No. of S3 request retriesawsCredentialsProvider
- A credentials provider used to instantiate the client.@Bean(name={"file.system.s3","file.system.s3n","file.system.s3a"}) @Order(value=1) @ConditionalOnBean(value=com.amazonaws.services.s3.AmazonS3Client.class) public FileTransfer s3FileTransferImpl(com.amazonaws.services.s3.AmazonS3Client s3Client, com.netflix.spectator.api.Registry registry) throws GenieException
s3Client
- S3 client to initialize the serviceregistry
- The metrics registry to useGenieException
- if there is any problem