I wanted to do some labs and learn Terraform.
I’ve installed the Terraform, updated the PATH and installed the extension in Visual Studio Code.
Terraform appears to be correctly configured since “Terraform –version” gives me actual output.
The issue is when I created the Providers.tf, added the provider:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
}
}
provider "azurerm" {
features {}
client_id = "Redacted"
client_secret = "Redacted"
tenant_id = "Redacted"
subscription_id = "Redacted"
}
Then I hit “Terraform init” – appears to be successful:
PS C:UsersDamianPCDocumentsej> terraform init
Initializing the backend...
Initializing provider plugins...
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
But.. no additional files as provider.exe etc. are created.
So, in the end I am not able to create resources at all.
As a cherry on top – looks like Terraform fmt
doesn’t do much even when I purposely make the code look awful.
Could you please let me know what do I do wrong?
I’ve tried using other templates to deploy providers, other authentication methods – exact same thing.
Damian Cichopek is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.