Using HashiCorp Vault integration for automation
When you use Packer in pipelines it may be useful to add HashiCorp Vault for short-lived credentials. When building cloud images, shouldn’t each build pipeline use its own cloud credentials and purge them afterward? What if Packer or part of the pipeline fails and doesn’t get a chance to revoke any credentials used? HashiCorp Vault is there to rotate and revoke your unused credentials.
If the runner service you select is a VM within the cloud, then Packer may automatically use the service account presented to the VM itself. In this case, there may be no need to use Vault credentials. AWS, Azure, and GCP all support this option. If you are using a local runner or building for multicloud, Vault is the best way to provide secure credentials for Packer pipelines.
This section builds on the Vault discussions from Chapter 3, Configuring Builders and Sources. It assumes a basic knowledge of HashiCorp Vault but focuses solely...