One of the challenges of IaC is the protection of sensitive information that is part of the infrastructure.
Indeed, one of the advantages of IaC is the possibility to version the code in a Git repository and so this code benefits from the Git workflow of versioning and validation of the code. However, with this approach, we tend to write everything in this code, sometimes forgetting that some data that is sensitive, such as passwords or login strings, can be misused if they end up in the wrong hands.
In this recipe, we will study how to protect this sensitive data by storing it in Azure's secret manager, which is Azure Key Vault, and then using it in the Terraform configuration.
Getting ready
For this recipe, we assume the use of Azure Key Vault. For more information, you can refer to the following documentation available at https://docs.microsoft.com/en-us/azure/key-vault/.
In an Azure Key Vault that we have created in Azure...