![Learning DevOps](https://wfqqreader-1252317822.image.myqcloud.com/cover/384/36698384/b_36698384.jpg)
上QQ阅读APP看书,第一时间看更新
Initialization
The initialization step allows Terraform to do the following:
- Initialize the Terraform context to check and make the connection between the Terraform provider and remote service—in our case, with Azure.
- Download the plugin(s) of the provider(s)—in our case, it will be the azurerm provider.
- Check the code variables.
To execute the initialization, run the init command:
terraform init
The following is a screenshot of terraform init:
![](https://epubservercos.yuewen.com/A085E6/19470376308796106/epubprivate/OEBPS/Images/c7b42edf-71e2-4cd3-8e70-d9ed26b48fc8.png?sign=1738926968-oADCf7xTUxtiqbYKiPJCDBnCwUm3KcVy-0-cdf325f5136efe697c79bd93ad045305)
As can be seen during its execution of the preceding command, Terraform does the following:
- It downloads the latest version of the azurerm plugin.
- It creates a working .terraform directory.
The following is a screenshot of the .terraform directory:
![](https://epubservercos.yuewen.com/A085E6/19470376308796106/epubprivate/OEBPS/Images/e210f780-4c32-47da-850e-16045308546e.png?sign=1738926968-1gMLRJ0pMz2b98gmwFzTXVfKLYOenILr-0-0d8d88ac0093521ed3d470c810282f4e)
For more information about the init command line, see the documentation: https://www.terraform.io/docs/commands/init.html.
Once the initialization step is done, we can proceed to the next step, which is previewing the changes.