Azure Infrastructure with Terraform
Abhishek Yadav
SCCM Architect | Endpoint Mobility - Security | MDM | Intune | Azure | Autopilot | M365 | IAM | MECM | MEM
I have just started exploring Terraforms as IaC (Infra as a Code) for creating Azure resources. The official documentation from both Microsoft and HasiCorp are rich enough.
But I kept falling for a very small glitch\mistake while trying to run terraform commands like init, plan, apply etc.
So basically all the prerequisites were in place like Azure CLI, Terraforms plugin(environment variable created), VS code for IDE, a working Azure subscription etc.
az login worked fine and I was connected to my azure subscription.
but when running the terraform commands it just ended with a generic success command for example 'terraform init -upgrade' or 'terrafrom init' gives:
It doesn't actually downloads the azurerm provider files.
'terraform plan' or 'terraform plan -out main.tfplan' gives:
'terraform apply' says 'Apply Complete!' But 0 resources were created.
So the solution in this case was to actually saving the files previously created main.tf, provider.tf , output.tf and variable.tf . Once the files were saved it all worked fine.
Its pretty basic but now I realize it can happen to anyone when starting.
'Terraform init' finally downloaded and installed the provider plugin.
More in this coming soon..