Template injection populates a template with supplied values to produce a concrete file or configuration. In software pipelines, it lets a secrets manager write credential files directly to their required locations. section 6.2.2
A useful implementation should:
- Provide a command-line workflow that reads secret references from a template and writes the populated file in one step. section 6.2.2
- Support automated pipeline access through service accounts or equivalent machine-to-machine credentials. section 6.2.2
Generating a Terraform credential file
A template can contain a secret reference such as {{ op://vault-name/terraform-cloud/team-api-token }}; running op inject -i terraformrc.tpl -o ~/.terraformrc writes the concrete Terraform configuration. section 6.2.2
$ op inject -i terraformrc.tpl -o ~/.terraformrc
Shows the single-step CLI pattern for injecting secrets into a target file. section 6.2.2
