Skip to content

Commit 9ac54d5

Browse files
authored
Update README.md
1 parent daa2334 commit 9ac54d5

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
1-
<img align="right" src="https://raw.githubusercontent.com/ericdallo/spring-s3-properties-loader/images/spring-icon.png?raw=true" width="144" height="200"/>
2-
# Spring S3 Property Loader #
1+
<img align="right" src="https://raw.githubusercontent.com/ericdallo/spring-s3-properties-loader/images/spring-icon.png?raw=true" width="120" height="120"/>
2+
# Spring S3 Property Loader
33

44
S3 Property Loader has the aim of allowing loading of Spring property files from S3 bucket, in order to guarantee stateless machine configuration.
55

66
Spring PropertyConfigurer replaces standard PropertyConfigurer to load property files from AWS S3 bucket. S3 path could be specified directly into spring beans.
77

8+
### Install
9+
Gradle:
10+
```groovy
11+
compile "com.spring.loader:s3-loader:1.0.1"
12+
```
13+
Maven:
14+
```xml
15+
<dependency>
16+
<groupId>com.spring.loader</groupId>
17+
<artifactId>s3-loader</artifactId>
18+
<version>1.0.1</version>
19+
<type>pom</type>
20+
</dependency>
21+
```
22+
### How to use
23+
24+
Declare a spring bean `S3PropertyPlaceholderConfigurer` using yours AWS credencials or AWS instance profile. e.i:
25+
26+
```java
27+
@Bean
28+
S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer(AmazonS3 s3) {
29+
S3ResourceLoader s3ResourceLoader = new S3ResourceLoader(s3);
30+
S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer = new S3PropertyPlaceholderConfigurer(s3ResourceLoader);
31+
s3PropertyPlaceholderConfigurer.setS3Locations(new String[]{"s3://my-bucket/my-folder/my-properties.properties"});
32+
33+
return s3PropertyPlaceholderConfigurer;
34+
}
35+
```

0 commit comments

Comments
 (0)