• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Waypoint
  • Install
  • Tutorials
  • Documentation
  • CLI
  • Plugins
  • Try Cloud(opens in new tab)
  • Sign up
Waypoint Home

Documentation

Skip to main contentOverview
  • Getting Started


  • URL Service
  • Logs
  • Exec
    • Overview
    • Dynamic Values
    • Files
    • Internal Values
    • Workspace and Label Scoping
  • Workspaces
  • Plugins
  • Triggers

  • Troubleshooting
  • Glossary

  • Roadmap

  • Resources

  • Tutorial Library
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  1. Developer
  2. Waypoint
  3. Documentation
  4. App Configuration
  5. Files
  • Waypoint
  • v0.9.x
  • v0.8.x
  • v0.7.x
  • v0.6.x
  • v0.5.x
  • v0.4.x
  • v0.3.x
  • v0.2.x
  • v0.1.x

ยปConfiguration Files

Waypoint can write application configuration to files. This is useful for applications that expect their configuration at a certain path or in a certain format. For example, you can write JSON, YAML, XML files for web frameworks or other services.

Writing a Configuration File

Application configuration file rendering must be configured in the waypoint.hcl file in the config stanza. The example below writes a file config/database.yml relative to your deployed and running application:

config {
  file = {
    "config/database.yml" = templatefile("${path.project}/database.yml.tpl", {
      host = "db.service"
    })
  }
}

The template database.yml.tpl may look like this:

production:
  host: ${host}
  username: myuser
  password: mypass

Notice that since we're using the templatefile function, we can template the file by using variables such as ${host} within our file. In this example, we set host to a static string, but the variable may also reference internal values which allow files to be built up of dynamic values as well. When a value changes at runtime, Waypoint will re-render your configuration file and send a signal to your application.

File Change Signal

If the input variables to a configuration file change at runtime, Waypoint will rerender the file and signal your application. By default, Waypoint will send the signal SIGUSR2. Waypoint expects your application to respond to this signal by reloading the configuration.

The file change signal can be customized using the file_change_signal field in the config stanza. For example, you SIGHUP is a common signal for reloading configuration. You could configure your application to receive this signal:

config {
  file_change_signal = "HUP"
}
Edit this page on GitHub

On this page

  1. Configuration Files
  2. Writing a Configuration File
  3. File Change Signal
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)