What does a Platform (DevOps) Engineer do? 💻🤔
The following is a technical review of a series of issues that has taken over my life for the last week or 2. Please feel free to ask questions. Terraform Provider Lock Seemingly out of nowhere, our Azure pipelines stopped working. They would make it all the way to the apply stage, but then a Terraform provider lock resulted in following error: │ Error: Inconsistent dependency lock file │ The given plan file was created with a different set of external dependency │ selections than the current configuration. A saved plan can be applied only │ to the same configuration it was created from. │ │ Create a new plan from the updated configuration. This took all day to figure out. No changes were made to the pipeline and I am still unsure how this started. The issue was a block of code in the azure-pipeline.yaml file that locks terraform provider (azurerm, azuread) versions in place. Somehow those versions were showing up different from the planning stage to the apply. We only figured this out because someone put the azure pipeline and the error message into Sage AI and it told us the issue was that specific block of code. Version Upgrades One of the potential fixes was a version upgrade to the Terraform version as well as the 2 main provider plugins, azurerm and azuread. In our system, this can be a lengthy process. First, you have to find every external module and create a feature. Then you have to set the new provider versions in that module and any sub-module to that module. Then, back in the main repo, set the source in the call to that module to the feature branch. Now in the main repo, update the version numbers and any sub-modules inside this repo. (Note: In terraform, a module can be housed inside another repo, or external to it). From here, you want to run a terraform plan. This checks your code against the current infrastructure and tells you if anything needs to be changed according to your state file and the code. If that all checks out, you run your code through the pipeline and all goes well.