Internal Values
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.
Internal values are static or dynamic configuration values that can be referenced by environment variables, files, or other internal variables to compose values. An example common usecase is building a database connection string which requires a database host, username, password, etc. that may come from difference sources.
Using Internal Values
Internal values are declared in the waypoint.hcl
file in the
config
stanza. The example below configures
an internal value that reads a database username and host from a Terraform
output and then combines them in an environment variable:
The internal values db_host
and db_user
are never exposed directly
to the application. Instead, only the combined value created in the
DB_ADDR
env var is exposed.
If the dynamic value of the database host or user changes, the environment variable will subsequently be updated and the application will be restarted using standard application restart behavior.
Caveats
Configsourcer plugins must return string type values to be used as internal values. With the terraform-cloud configsourcer, always specify an output, and only use outputs that of the type string.