ConfigSourcer
Warning
This content is part of the legacy version of Waypoint that is no longer actively maintained. For additional information on the new vision of Waypoint, check out this blog post and the HCP Waypoint documentation.
https://pkg.go.dev/github.com/hashicorp/waypoint-plugin-sdk/component#ConfigSourcer
ConfigSourcer
can be implemented to dynamically load configs from external
sources such as Vault and Terraform Cloud.
Waypoint uses dynamic config sourcers to run alongside the application. The
plugin interface expects a ReadFunc()
for reading configuration and a
StopFunc()
for stopping configuration sourcing.
Below is an abbreviated example of the Terraform Cloud ConfigSourcer ReadFunc()
.
Getting your plugin into the CEB
To write your own config sourcer, the Waypoint entrypoint needs to be able to load and run your plugin. Unfortunately today there is no supported way for the CEB to automatically load your plugin. This means if you wish you write your own config sourcer plugin, you'll need to add the plugin in your own fork of Waypoint and build it from your fork to have your plugin included. You can also make a pull request to the main repository of Waypoint if you think your plugin makes sense.
We intend to provide a better way for the entrypoint to load custom plugins in the future that does not require users building their own version of Waypoint with their custom config sourcer plugin.