It took me a long time to realise that I had to prefix the BINDABLE_NAME examples on this page with the service name for the resource specific variables to work. Maybe the documentation can show that better per bindable name example.
${my-service.BINDABLE_NAME}
So for database,
${HOSTNAME}
should be
${my-db-service.HOSTNAME}
in reality...