File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -14,27 +14,40 @@ repositories {
14
14
}
15
15
```
16
16
``` groovy
17
- compile "com.spring.loader:s3-loader:1.0.2 "
17
+ compile "com.spring.loader:s3-loader:1.0.3 "
18
18
```
19
19
Maven:
20
20
``` xml
21
21
<dependency >
22
22
<groupId >com.spring.loader</groupId >
23
23
<artifactId >s3-loader</artifactId >
24
- <version >1.0.2 </version >
24
+ <version >1.0.3 </version >
25
25
<type >pom</type >
26
26
</dependency >
27
27
```
28
+
28
29
## How to use
29
30
30
- Declare a spring bean ` S3PropertyPlaceholderConfigurer ` using yours AWS credencials or AWS instance profile. e.i:
31
+ There 2 ways to configure your application to load properties from s3:
32
+
33
+ * Anotation*
34
+ Add this annotation to any spring managed bean
35
+ ``` java
36
+ @S3PropertiesLocation (" my-bucket/my-folder/my-properties.properties" )
37
+ ```
31
38
39
+ * Configuration*
32
40
``` java
33
41
@Bean
34
- S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer(AmazonS3 s3 ) {
35
- S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer = new S3PropertyPlaceholderConfigurer (s3 );
42
+ S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer(AmazonS3 amazonS3 ) {
43
+ S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer = new S3PropertyPlaceholderConfigurer (amazonS3 );
36
44
s3PropertyPlaceholderConfigurer. setS3Locations(" s3://my-bucket/my-folder/my-properties.properties" );
37
45
38
46
return s3PropertyPlaceholderConfigurer;
39
47
}
40
48
```
49
+
50
+ ## Requisites
51
+
52
+ Official spring aws sdk lib.
53
+ See: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws
You can’t perform that action at this time.
0 commit comments