Terraform Nuggets: What is terraform init

 Terraform init initializes your working directory containing the terraform configuration files. This is the first command to be run. It would load all the modules referenced in your configuration files and load all the provders referenced in your configuration files.

During init the configuration is searched for module blocks, and the source code for the reference modules is retrieved from the locations given in their source arguments. 

Most terraform providers are published separately from terraform as plugins. During init terraform searches the configuration for both direct and indirect references to providers and attempts to install the plugins for those providers. After successful installation terraform writes details about the selected providers in the dependency lock file. You should commit this file in the version control system to make sure that when the next time terraform init is run terraform will select exactly the same provider versions. Use -upgrade option if you want terraform to ignore the dependency lock file and consider installing newer versions. 

Comments

Popular posts from this blog

python3: unpickling error

Azure Data Analytics: Part1: Hosting Data Lake storage: Gen1 and Gen2