zalando/spring-cloud-config-aws-kms

Automatic region discovery

Closed this issue · 7 comments

kinow commented

Hi, the region is a required parameter for the library, but maybe instead it could

  • check if the region was provided
  • if not, then query the metadata server to retrieve the region
  • if the metadata server returned a region, use it
  • otherwise, fail
kinow commented

Perhaps check if the environment variable AWS_DEFAULT_REGION has been set as well.

@kinow

Maybe u want to use this spring-boot-starter in combination whit this one? It does not handle all your requirements/ideas but could be a starting point.

Regards
Jörg

kinow commented

It looks really interesting, I hadn't seen the project (though I saw another interesting one in the same repository last week).

Will take a look how hard it would be to combine both, and try to suggest in a pull request an implementation for this.

Thanks heaps
Bruno

If you are interested in more spring-boot-starters, then have a look to this repository as well.

kinow commented

The automatic region discovery through that spring-boot-starter worked like a charm. Had some Exception in thread "main" java.lang.NoClassDefFoundError: com/amazonaws/transform/JsonErrorUnmarshallerV2, but solved by excluding one AWS dependency.

Here's what I changed in a test project that already had this KMS library. In pom.xml:

+snip+
        <dependency>
            <groupId>org.zalando.automata</groupId>
            <artifactId>aws-support-spring-boot-starter</artifactId>
            <version>${aws-support-spring-boot-starter.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.amazonaws</groupId>
                    <artifactId>aws-java-sdk-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
+snip+

Where the version was 0.0.2.

kinow commented

Might leave this open in case we could update the README by pointing that users could either use bootstrap.yml properties, or then add a dependency to the other library.

Since we released the AWS Support as top level project now we should definitely point to https://github.com/zalando-incubator/aws-support-spring-boot-starter on the README