![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=1738926731-9x37c5P9HbWLyVYW0a9Yir7nUKkd9cjY-0-12e8086fb4d9d2c734d8eed3ea14bc8e)
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=1738926731-DPVcFpT8mpylFemqNq0ikalUL0SwmELb-0-a9f6c216a00255332ee9098135a8d049)
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.