Skip to content

The aim of this library is to provide a simple mechanism to load configuration properties from a properties file stored in AWS S3.

License

Notifications You must be signed in to change notification settings

cirrus-up-cloud/spring-s3-properties-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring S3 Properties Loader

The aim of this library is to provide a simple mechanism to load configuration properties from a properties file stored in AWS S3.

How to use it

  1. Add dependency into pom.xml.
<dependency>
    <groupId>cloud.cirrusup</groupId>
    <artifactId>spring-s3-properties-loader</artifactId>
    <version>1.0</version>
</dependency>
  1. In your Spring XML files, simply define a PropertySourcesPlaceholderConfigurer, as it follows:
<bean id="s3PropertyPlaceholder" class="cloud.cirrusup.S3PropertySourcesPlaceholderConfigurer">
        <constructor-arg name="amazonS3" ref="amazonS3"/>
        <constructor-arg name="bucket" value="your-bucket"/>
        <constructor-arg name="fileName" value="path/to/file.properties"/>
</bean>

In order to get the maximum flexibility, you can set values for bucket and filename using Java system properties.

<bean id="s3PropertyPlaceholder" class="cloud.cirrusup.S3PropertySourcesPlaceholderConfigurer">
        <constructor-arg name="amazonS3" ref="amazonS3"/>
        <constructor-arg name="bucket" value="#{systemProperties['s3.config.bucket']}"/>
        <constructor-arg name="fileName" value="#{systemProperties['s3.config.filename']}"/>
</bean>

About

The aim of this library is to provide a simple mechanism to load configuration properties from a properties file stored in AWS S3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages