@@ -59,18 +59,24 @@ metadata = {
5959 bin_path = []
6060
6161 # TODO: Remove this comment block after customizing the file.
62- # ` env` : this SHOULD be defined when your extension needs specific environment
63- # variables to be set within the PostgreSQL process to function correctly.
64- # This is a map of key-value pairs.
65- # Usually empty. Used in tests and to generate image catalogs.
66- # Examples:
67- # { " FOO" = " foo" }
68- # HCL uses ` ${}` for interpolation, so ` $` must be escaped.
69- # To use a CNPG placeholder (expanded later by the operator):
70- # { " BAR" = " $${image_root}/bar" }
71- # To produce a literal ` ${...}` that the operator should NOT expand:
72- # { " BAZ" = " $$${not_expanded}/baz" }
73- env = {}
62+ # ` env` : Optional map of environment variables to be injected into the
63+ # PostgreSQL process for this extension.
64+ #
65+ # NOTE: Because HCL uses ` ${}` for its own interpolation, you must escape the
66+ # '$ ' sign for any value intended for the CNPG operator.
67+ #
68+ # 1. CNPG Placeholders: Use ` $${}` to pass a placeholder to the operator.
69+ # Example: { " LIB_PATH" = " $${image_root}/lib" }
70+ # -> Result in Postgres: LIB_PATH= /extensions/my-extension/lib
71+ #
72+ # 2. Literal Values: Use ` $$${}` if you need a literal ` ${}` to appear in
73+ # the final environment variable without being expanded by the operator.
74+ # Example: { " TOKEN_FORMAT" = " $$${value}" }
75+ # -> Result in Postgres: TOKEN_FORMAT= $ {value}
76+ #
77+ # 3. Static Values: No special escaping needed.
78+ # Example: { " DEBUG" = " true" }
79+ env = {}
7480
7581 # TODO: Remove this comment block after customizing the file.
7682 # ` auto_update_os_libs` : set to true to allow the maintenance tooling
0 commit comments