Dropwizard provider to retrieve application configuration from an S3 URI.
<dependency>
<groupId>com.brightcove</groupId>
<artifactId>dropwizard-s3-config</artifactId>
<version>1.0.0</version>
</dependency>
dependencies {
compile(
...
'com.brightcove:dropwizard-s3-config:1.0.0',
Simply set the ConfigurationSourceProvider
in the initialize
method to refer to an S3ConfigurationProvider
instance:
public class MyApplication extends Application<MyConfiguration> {
@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
// load configuration from an S3 URI
bootstrap.setConfigurationSourceProvider(new S3ConfigurationProvider());
}
}
Supply the S3 URI for the configuration file to the server
Dropwizard command. For example:
java -jar target/my-app.jar server s3://bucket/key/config.yml
Name | Purpose | Required? |
---|---|---|
AWS_ACCESS_KEY |
Access key ID | Yes |
AWS_SECRET_ACCESS_KEY |
Secret Access Key | Yes |
AWS_S3_ENDPOINT |
Alternate endpoint for S3 server, useful for testing against a local fake S3 server | No |
AWS_REGION |
AWS region to use when accessing S3 | No |