How to Create DeployConfig.json for a FOLIO Module
How to Create DeployConfig.json for a FOLIO Module
A step-by-step guide for developers on authoring the DeployConfig.json file required at the repository root of every back-end FOLIO module per ADR-0013 — Module configuration management.
1. What this file is
DeployConfig.json is a standardized, machine-readable description of a module's deployment footprint. It lives at the root of the module repository and declares, in one place:
the container resource requests the module needs (CPU, memory),
JVM tuning (heap, metaspace, garbage collector),
high-availability and replica guidance,
Kong gateway timeout expectations, and
the complete set of environment variables the module reads, each with a safe default, a description, a category, and whether it is essential.
The file is not environment-specific deployment configuration. It is a template and documentation contract: the values in it are authoritative defaults, and every environment-specific override continues to live in the deployment platform (Helm values, container orchestration task definitions, etc.). Deployment tooling reads this file to understand what a module expects and what it can be tuned with.
ADR-0013 introduced this convention to replace configuration knowledge that was previously scattered across wiki pages, Helm values, and informal notes — and usually out of date by the time a release was cut.
2. Scope — which repositories need one
Applies to | Does not apply to |
|---|---|
Back-end modules ( | UI modules ( |
Edge modules ( |
|
The Eureka sidecar ( | Infrastructure-as-code repos (folio-helm-v2, folio-ansible) |
Each back-end module adds exactly one DeployConfig.json at its repository root.
3. The schema
The structure is defined by a Zod schema maintained in FOLIO-4575 — Create schema for DeployConfig.json validation (the schema file is attached to that ticket). You can validate your file against it before raising a PR. The sections below describe the structure the schema enforces.
3.1 Top-level shape
json
{
"description": "<module-name> configuration template",
"moduleDefaults": { ... }
}description— a short human-readable label for the file.One defaults block:
a regular module repository uses
moduleDefaults;the sidecar repository (
folio-module-sidecar) usessidecarDefaults.
You may optionally add a top-level
_disclaimerstring noting the reference baseline the default values were calibrated against. It is informational only.
3.2 Sections inside the defaults block
Section | Type | Purpose |
|---|---|---|
| array of | Container CPU and memory requests/limits |
| array of | JVM flags (heap, metaspace, GC) |
|
| HA capability and replica guidance |
|
| Gateway proxy timeouts |
| array of env-var entries (see §3.3) | Every environment variable the module reads |
3.3 EnvVars entry
Each environment variable is one object:
json
{
"name": "VAR_NAME",
"value": "<default>",
"description": "What the variable controls and when to change it.",
"type": "<TYPE>",
"essential": false
}Field | Type | Notes |
|---|---|---|
| string | The exact environment variable name |
| string, boolean, or | Default value; |
| string | One sentence; do not repeat the variable name |
| string | One of the allowed categories (see §3.4) |
| boolean |
|
3.4 Allowed type values
Only these categories are valid. Do not invent new ones.
Type | Use for |
|---|---|
| Database connection — URL, credentials, pool sizes |
| General application configuration |
| Kafka bootstrap, topics, consumer/producer settings |
| Object-storage settings |
| Feature flags, behavioural toggles, business-logic parameters |
| Cache sizes, TTLs, eviction policies |
| Keycloak URLs, client IDs, JWT/JWKS settings |
| Quarkus runtime settings — thread pool, HTTP limits, logging, TLS |
3.5 Environment variable conventions (TC policy)
The EnvVars entries you author must comply with FOLIO's platform-wide Environment Variables policy (DR-000044), maintained by the Technical Council.
Naming rules
Names MUST be uppercase letters, digits, and underscores only (
[A-Z0-9_]). No dots or periods.Use the standardized category prefixes:
Category | Prefix / name | Examples |
|---|---|---|
Database |
|
|
Kafka |
|
|
S3 / cloud storage |
|
|
Elasticsearch |
|
|
System user |
|
|
Environment |
|
|
System integration |
|
|
Java runtime |
|
|
Spring framework |
|
|
Feature flags |
|
|
Prefer S3_ over AWS_ for cloud storage to stay vendor-neutral while signalling S3-API compatibility.
Required vs. optional — this is exactly the essential flag
The policy's "Required" concept maps directly to DeployConfig's essential. The governing principle: if a variable has a default value in the module code, it is NOT required → set essential: false. Mark essential: true only when the module cannot function without the variable and no sensible default exists. Required variables should make the module fail fast on startup with a clear error when missing; optional variables fall back to their documented default.
Keep in sync with the ModuleDescriptor
The same variables — with descriptions — must also be declared in the top-level env property of descriptors/ModuleDescriptor-template.json, which the policy designates as the machine-readable source of truth. The description you write in DeployConfig.json should match the intent documented there. (DevOps tooling generates the human-readable ENV_VARS.md from the ModuleDescriptor.)
Migration — supporting both legacy and standardized names
When a module supports both a legacy and a standardized name (e.g. AWS_URL → S3_URL), list both in EnvVars. The standardized variable takes precedence; state the fallback relationship in each description.
4. Authoring steps
Step 1 — Choose the top-level defaults key
If the repository is folio-module-sidecar, use sidecarDefaults. Every other back-end module uses moduleDefaults.
Step 2 — Collect every environment variable the module reads
The authoritative list is what the module actually consumes. For most modules these appear as ${VAR_NAME} or ${VAR_NAME:default} patterns in src/main/resources/application.properties (or the equivalent configuration file). Profile-prefixed lines (%fips., %prod., %dev.) still count — a variable declared only under a profile is still a variable the module reads.
bash
grep -oP '\$\{\K[A-Z_][A-Z0-9_]+(?=[:}])' src/main/resources/application.properties | sort -uThis is your required set — every name here must appear in EnvVars.
If some variables are read directly from code rather than declared in a properties file, you must still include them. The properties file is the usual source, but the goal is every variable the module actually reads.
Cross-check your set against the
envproperty ofdescriptors/ModuleDescriptor-template.json— per the TC Environment Variables policy (§3.5) that is the machine-readable source of truth, and yourEnvVarslist should align with it.
Ignore internal framework config references that are hardcoded (e.g. plain
quarkus.*properties with no${VAR}wrapper) — those are not environment variables.
Step 3 — Fill in resources
json
"resources": [
{ "name": "cpu", "value": "64", "description": "CPU request/limit for container" },
{ "name": "memory", "value": "1024", "description": "Memory hard limit for container (MiB)" },
{ "name": "memoryReservation", "value": "896", "description": "Memory reservation / soft limit (MiB)" }
]Use the recommended values for your module from the published Modules configuration details Confluence page. If your module is not yet listed there, use a sensible baseline (memory=1024, memoryReservation=896, cpu=64) and note it in the PR description so a reviewer can confirm.
Step 4 — Fill in java
json
"java": [
{ "name": "xmx", "value": "768m", "description": "Maximum Java heap size" },
{ "name": "MaxMetaspaceSize", "value": "256m", "description": "Maximum Java metaspace size" },
{ "name": "MetaspaceSize", "value": "88m", "description": "Initial Java metaspace size" }
]Naming convention — strip the JVM flag prefix and use the remainder as name:
JVM flag |
|
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The Eureka sidecar uses the low-pause ZGC collector (UseZGC=true); regular Spring Boot modules typically do not unless explicitly configured.
Step 5 — Fill in deployment
json
"deployment": {
"isHaSupported": true,
"replicasRecommendedCount": 2,
"description": "Deployment guidance for the module. Note any HA constraints here."
}isHaSupported—trueunless the module has a known singleton constraint (e.g. a file lock or an in-process scheduler with no distributed coordination). If a scheduled job runs per replica but is safe to run concurrently (idempotent), the module is still HA-capable — explain this in thedescription.replicasRecommendedCount—2is the default for HA-capable modules. The sidecar uses1because it scales with the module it accompanies rather than independently.
Step 6 — Fill in kong
json
"kong": {
"timeouts": { "connect": "60s", "send": "60s", "read": "120s" },
"description": "Custom Kong proxy timeouts. Explain why read exceeds the 60s default."
}The read timeout must be at least as large as the module's longest legitimate request processing time. Raise it above the 60s default for modules with known long-running endpoints (bulk operations, data import/export, synchronous fan-out calls) and explain the reason in the description. A safe general default is 120s.
Step 7 — Fill in EnvVars
Add one entry per variable from your required set (Step 2). For each entry:
Choosing value:
Start from the default declared in the properties file.
Set
nullfor:variables with no application default (required at deploy time),
secrets, passwords, key-store paths, and tokens — never put real secret values here,
environment-specific URLs and hostnames (these differ per deployment).
Use JSON booleans (
true/false), not the strings"true"/"false".Use strings for numeric defaults (
"50","9092") to match how they are supplied as env vars.
Choosing essential:
Set "essential": true when the variable has no default and its absence would prevent the module from starting or functioning — typically URLs, module identity fields (MODULE_NAME, MODULE_VERSION, ENV), and the secret-store selector (SECRET_STORE_TYPE). This is the same as the TC policy's Required classification (§3.5): a variable that has a default in the module code is never essential.
Checking the name: confirm it follows the TC naming conventions in §3.5 — uppercase, underscores only, no dots, and the correct category prefix (DB_, KAFKA_, S3_, etc.).
Choosing type: pick the single best-fit category from §3.4.
Writing description:
One sentence stating what the variable controls and when to change it.
For optional TLS variables, note which parent flag enables them.
For cache sizes, state the unit (entries, seconds, minutes).
Do not repeat the variable name.
5. Validate before you commit
Run both coverage directions plus a secrets scan and a schema check.
Forward check — every property maps to an entry
bash
grep -oP '\$\{\K[A-Z_][A-Z0-9_]+(?=[:}])' src/main/resources/application.properties | sort -u > /tmp/props-vars.txt
python -c "
import json
d = json.load(open('DeployConfig.json'))
root = d.get('moduleDefaults') or d.get('sidecarDefaults')
print('\n'.join(sorted(e['name'] for e in root['EnvVars'])))
" > /tmp/config-vars.txt
# Vars in properties but missing from the file (should be empty):
comm -23 /tmp/props-vars.txt /tmp/config-vars.txtReverse check — no phantom entries
bash
# Entries in the file with no backing property reference (should be empty):
comm -13 /tmp/props-vars.txt /tmp/config-vars.txtClean-values check — no environment-specific data or secrets
No value should contain a real hostname, region, broker address, account name, token, or password. Scan for common giveaways:
bash
python -c "
import json, re
d = json.load(open('DeployConfig.json'))
root = d.get('moduleDefaults') or d.get('sidecarDefaults')
bad = re.compile(r'(us-east|us-west|eu-west|ap-southeast|s3://|arn:aws|\.internal\.|\.local\.)', re.I)
for e in root['EnvVars']:
if bad.search(str(e.get('value',''))):
print(e['name'], '->', e['value'])
"Schema check
The file is valid JSON:
python -m json.tool DeployConfig.json > /dev/nullThe defaults key is exactly
moduleDefaultsorsidecarDefaults(not both, notdefaults).Every
typeis one of the eight allowed strings (§3.4).Every
EnvVarsentry hasname,value,description,type, andessential.Optionally validate against the Zod schema attached to FOLIO-4575.
6. Commit, PR, and NEWS
Commit message
TICKET-KEY: Add DeployConfig.json per ADR-0013NEWS.md entry (inside the current in-progress version block):
markdown
* Add DeployConfig.json (ADR-0013 Configuration Management) ([TICKET-KEY](https://folio-org.atlassian.net/browse/TICKET-KEY))PR checklist — this is a config-only addition: tick Self-reviewed Code, Change Notes (the NEWS entry), and Testing; it is not a breaking change. Tick Environment Recreation Test because deployment tooling consumes this file.
7. Worked examples
Two complete, merged-style reference files from the proof-of-concept are the best templates to copy from:
Example | What it demonstrates |
|---|---|
mod-rtac-cache | A regular Spring Boot module ( |
folio-module-sidecar | The Eureka sidecar ( |
A minimal regular-module skeleton:
json
{
"description": "mod-example configuration template",
"moduleDefaults": {
"resources": [
{ "name": "cpu", "value": "64", "description": "CPU request/limit for container" },
{ "name": "memory", "value": "1024", "description": "Memory hard limit for container (MiB)" },
{ "name": "memoryReservation", "value": "896", "description": "Memory reservation / soft limit (MiB)" }
],
"java": [
{ "name": "xmx", "value": "768m", "description": "Maximum Java heap size" },
{ "name": "MaxMetaspaceSize", "value": "256m", "description": "Maximum Java metaspace size" }
],
"deployment": {
"isHaSupported": true,
"replicasRecommendedCount": 2,
"description": "Stateless module; safe to run multiple replicas."
},
"kong": {
"timeouts": { "connect": "60s", "send": "60s", "read": "120s" },
"description": "Read timeout raised to 120s for longer-running list endpoints."
},
"EnvVars": [
{
"name": "DB_HOST",
"value": null,
"description": "PostgreSQL host used by the datasource JDBC URL.",
"type": "DB",
"essential": true
},
{
"name": "KAFKA_MAX_POLL_RECORDS",
"value": "50",
"description": "Maximum number of Kafka records returned in a single consumer poll.",
"type": "KAFKA",
"essential": false
},
{
"name": "SYSTEM_USER_ENABLED",
"value": false,
"description": "Enables legacy Okapi system-user token retrieval for background calls.",
"type": "FUNCTIONAL",
"essential": false
}
]
}
}Proof-of-concept tasks
The PoC that validated this approach was tracked under FOLIO-4560. The individual module tasks make useful end-to-end references:
MODSIDECAR-216 — folio-module-sidecar (sidecar example)
MODRTACHCE-66 — mod-rtac-cache (regular module example)
MODORDERS-1478 — mod-orders
MODBULKOPS-684 — mod-bulk-operations
KEYCLOAK-133 — folio-keycloak
EDGRTAC-135 — edge-rtac
You can list all PoC tasks with the Jira filter:
parent = FOLIO-4560 AND labels in (POC)
8. Common pitfalls
Mistake | How to catch it |
|---|---|
Using |
|
Inventing type names ( | Check against the eight allowed values in §3.4 |
Wrong JVM flag | Strip exactly the |
Leaving an environment-specific URL as a default | All hostnames must be |
Missing variables | Run the forward check (§5) before the first commit |
Phantom variables | Run the reverse check (§5); delete anything not actually read by the module |
| Use JSON booleans |
Real secret values in | Run the clean-values scan (§5); secrets are always |
Non-compliant env var names (dots, | Check names against the TC naming conventions (§3.5) |
Marking a variable | Per TC policy, a variable with a default is never required (§3.5) |
9. References
Resource | Link |
|---|---|
ADR-0013 — Module configuration management |
|
Environment Variables policy (DR-000044) — naming, required/optional, documentation |
|
Environment variable naming convention |
|
Modules configuration details (resource/JVM values) |
|
Schema (Zod) for validation |
|
Adoption epic |
|
Regular-module example (mod-rtac-cache) |
|
Sidecar example (folio-module-sidecar) |
|