Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ericdallo authored and elo7-developer committed Mar 2, 2017
1 parent 8e77434 commit 1ddc372
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ repositories {
}
```
```groovy
compile "com.spring.loader:s3-loader:1.0.4"
compile "com.spring.loader:s3-loader:2.0.0"
```
Maven:
```xml
<dependency>
<groupId>com.spring.loader</groupId>
<artifactId>s3-loader</artifactId>
<version>1.0.4</version>
<version>2.0.0</version>
<type>pom</type>
</dependency>
```

## How to use

There 2 ways to configure your application to load properties from s3:

**Anotation**

- Adding this annotation to any spring managed bean
```java
@S3PropertiesLocation("my-bucket/my-folder/my-properties.properties")
Expand All @@ -42,20 +38,10 @@ There 2 ways to configure your application to load properties from s3:
```
- Load from a System env variable
```java
@S3PropertiesLocation(path = "${AWS_S3_LOCATION}", profiles = "production")
```
**Configuration**
```java
@Bean
S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer(AmazonS3 amazonS3) {
S3PropertyPlaceholderConfigurer s3PropertyPlaceholderConfigurer = new S3PropertyPlaceholderConfigurer(amazonS3);
s3PropertyPlaceholderConfigurer.setS3Locations("s3://my-bucket/my-folder/my-properties.properties");

return s3PropertyPlaceholderConfigurer;
}
@S3PropertiesLocation(path = "${AWS_S3_LOCATION}", profiles = "developer")
```

## Requisites

Official spring aws sdk lib.
See: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws
See: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-aws

0 comments on commit 1ddc372

Please sign in to comment.