When configuring HashiCorp Boundary, you may encounter the need to include special characters in your database connection string. If your password contains characters that need to be escaped, such as ];,#]G),;, you can use URL encoding to ensure proper handling without altering your environment variables. For instance, the password ];,#]G),; can be encoded as %5D%3B%2C%23%5DG)%2C%3B.
Here’s how you can set up your Boundary configuration file to include the encoded password:
controller {
name = "example-controller"
description = "An example controller"
database {
url = "postgresql://<username>:%5D%3B%2C%23%5DG)%2C%3B@10.0.0.1:5432/<database_name>"
max_open_connections = 5
}
}
To initialize your Boundary database with this configuration, use the following command:
boundary database init -config /boundary/boundary-config.hcl
For more detailed instructions on setting up PostgreSQL with Boundary, refer to the official documentation here.