powertools-lambda-java icon indicating copy to clipboard operation
powertools-lambda-java copied to clipboard

RFC: Use AppConfig Extension in Parameters module

Open jeromevdl opened this issue 3 years ago • 0 comments

Key information

  • RFC PR: (leave this empty)
  • Related issue(s), if known:
  • Area: (i.e. Tracer, Metrics, Logger, etc.) Parameters
  • Meet tenets: (Yes/no) that's a question

Summary

Add integration with AppConfig through the AppConfig Extension.

Motivation

The parameters module in Powertools for Java does not provide AppConfig integration. This integration can be achieved in two ways:

This RFC is about letting the developer choose his preferred option, and thus implement the two.

Proposal

  • Detect the presence of the extension (automatically, or with an environment variable set to true).
  • Get config from the extension: http://localhost:2772/applications/%s/environments/%s/configurations/%s
  • Developer must add the extension layer to his function.

This proposal has been drafted in #826 (code here)

Drawbacks

  • Need an additional layer (which is limited in each function)
  • The extension already provides the cache mechanism which is also implemented in Parameters.
  • Increase the size of the package : extension + SDK (unless we could avoid adding the SDK when using the extension)

Rationale and alternatives

N/A

Unresolved questions

Detect the presence of the extension (properly), rather than using an environment variable. Pinging the extension endpoint, or looking at /opt/extensions directory. But it slows down the overall execution.

jeromevdl avatar Apr 09 '22 17:04 jeromevdl