Production Checklist¶
Use this checklist before deploying an application that uses Confii.
Startup and Context¶
- Use
NewWithContextwhen startup should inherit deployment cancellation, tracing, or deadlines. - Configure
startup.timeoutin.confii.yamlfor the fallback startup deadline. - Configure
runtime.timeoutfor convenience methods that do not receive an explicit context. - Call
Closeduring shutdown so closeable providers and watchers are released.
Environment and Sources¶
- Prefer
environment_strategy: named_filesfor new services. - Keep one canonical environment name set: for example
development,staging,production. - Do not rely on
dev/prodaliases unless those are the actual configured environment names and filenames. - Use
confii planin CI or deployment preflight to confirm the selected environment and source order. - Avoid accidental hybrid environment models. Use
hybridonly for controlled migrations with an explicit conflict policy.
Validation¶
- Enable
validate_on_load. - Enable
strict_validationfor typed configuration. - Use
validatetags for field-level constraints. - Add JSON Schema when other tooling or non-Go producers need the same contract.
- Add custom validators for deployment policy, cross-field checks, or environment-specific invariants.
Secrets¶
- Use explicit provider routing for mixed backends:
${secret@provider:key}. - Declare
sensitive_pathsfor values that are sensitive even if they are not written as secret placeholders. - Never include credentials in loader
Source()strings, provider names, or error messages. - Run
confii connections testbefore deployment when using cloud or Vault providers. - Prefer provider default credential chains or workload identity over static credentials.
Operations¶
- Use
ReloadWithContext,ExtendWithContext, andRefreshSecretsWithContextfor runtime I/O. - Treat reload failures as rejected candidates; the previous snapshot remains active.
- Use
DetectDriftorconfii difffor deployment verification where configuration drift matters. - Enable events or metrics when operational visibility is needed.
Debugging and Exports¶
- Use
Explain,Layers,SourcePlan, andconfii debugto inspect values. - Protect exported effective configuration. It can contain resolved secrets.
- Keep debug reports and generated exports out of public logs unless redaction has been reviewed.
Supply Chain¶
- Pin Confii modules consistently.
- For cloud support, keep
confii-go/v2,loader/cloud/v2, andsecret/cloud/v2on compatible released versions. - Use build tags intentionally:
aws,azure,gcp,vault,ibm.