When executing the terraform init command, Terraform will check that the version of the installed Terraform binary that executes the Terraform configuration file corresponds to the version specified in the required_version property of the terraform block.
If it matches, it won't throw an error as it is greater than version 0.13. Otherwise, it will throw an error:
With regard to the specification of the provider version, when executing the terraform init command, if no version is specified, Terraform downloads the latest version of the provider, otherwise it downloads the specified version, as shown in the following two screenshots.
The following screenshot shows the provider plugin being downloaded from the specified source without us specifying the required version (at the time of writing, the latest version of the provider is 2.20.0):
As we can see, the latest version of the azurerm provider (2.20.0) has been downloaded.
In addition, the following screenshot shows the azurerm provider plugin being downloaded when we specify the required version (2.10.0):
As we can see, the specified version of the azurerm provider (2.10.0) has been downloaded.
In this required_version block, we also add the source property, which was introduced in version 0.13 of Terraform and is documented here: https://github.com/hashicorp/terraform/blob/master/website/upgrade-guides/0-13.html.markdown#explicit-provider-source-locations