|
| 1 | +# avaje-aws-appconfig |
| 2 | + |
| 3 | +This is a avaje-config ConfigurationSource that uses |
| 4 | +[AWS AppConfig](https://docs.aws.amazon.com/appconfig/latest/userguide/what-is-appconfig.html) |
| 5 | +as a source for configuration. |
| 6 | + |
| 7 | +The AWS AppConfig content can either be in `yaml` or `properties` |
| 8 | +format. |
| 9 | + |
| 10 | +This plugin will load configuration from the AWS AppConfig agent on initialisation |
| 11 | +and then additionally by polling the AppConfig agent (for changes to the config) |
| 12 | +and also when `Configuration.refresh()` is called. |
| 13 | + |
| 14 | +## Configuration |
| 15 | + |
| 16 | +- aws.appconfig.enabled - defaults to `true` |
| 17 | +- aws.appconfig.application - required |
| 18 | +- aws.appconfig.environment - required |
| 19 | +- aws.appconfig.configuration - defaults to `"default"` |
| 20 | +- aws.appconfig.pollingEnabled - defaults to `true` |
| 21 | +- aws.appconfig.pollingSeconds - defaults to `45` seconds |
| 22 | +- aws.appconfig.refreshSeconds - defaults to `(pollingSeconds - 1)` |
| 23 | + |
| 24 | + |
| 25 | +## Steps to use |
| 26 | + |
| 27 | +### Add dependency |
| 28 | + |
| 29 | +```xml |
| 30 | +<dependency> |
| 31 | + <groupId>io.avaje</groupId> |
| 32 | + <artifactId>avaje-aws-appconfig</artifactId> |
| 33 | + <version>...</version> |
| 34 | +</dependency> |
| 35 | +``` |
| 36 | + |
| 37 | +### Add to src/main/application.yaml |
| 38 | + |
| 39 | +```yaml |
| 40 | +aws.appconfig: |
| 41 | + application: my-application |
| 42 | + environment: ${ENVIRONMENT:dev} |
| 43 | + configuration: default |
| 44 | +``` |
| 45 | +
|
| 46 | +Or with more parameters like: |
| 47 | +
|
| 48 | +```yaml |
| 49 | +aws.appconfig: |
| 50 | + enabled: true |
| 51 | + application: my-application |
| 52 | + environment: ${ENVIRONMENT:dev} |
| 53 | + configuration: default |
| 54 | + pollingEnabled: true |
| 55 | + pollingSeconds: 60 |
| 56 | +``` |
| 57 | +
|
| 58 | +
|
| 59 | +### Add to src/test/application-test.yml |
| 60 | +
|
| 61 | +Turn it off for testing. When running tests we generally don't wish to |
| 62 | +pull configuration from AWS AppConfig. |
| 63 | +
|
| 64 | +```yaml |
| 65 | +aws.appconfig.enabled: false |
| 66 | +``` |
0 commit comments