Install az CLI
Follow these steps AZ CLI
Install terraform CLI
Link Terraform CLI
Open your command line and type for
Windows
:
terraform -version
az -version
Solution:
then RESTART your PC 😮💨
-
az login
- If there are many Subscriptions in Tenant or didnt specify Subscription_ID under the
provider
block *az account set --subscription "subcription id or Name"
- If there are many Subscriptions in Tenant or didnt specify Subscription_ID under the
-
Terraform Commands to RUN your CODE
Main commands [_sequence_]:
init Prepare your working directory for other commands
validate Check whether the configuration is valid
plan Show changes required by the current configuration
apply Create or update infrastructure
destroy Destroy previously-created infrastructure
>to save the plan [so that terraform could guarantee to take exactly those actions if you run "terraform apply"] run _"terraform plan -out plan.out_
>**ONLY FOR TESTING ENV** run "_terraform apply -auto-approve_" to automatically approve the resourses deployments
> Run "_terraform apply "plan.out"_ after runnning the plan.out command
>terraform lock file dependencies inconsistent with current configarations, Run : `terraform init -upgrade`
For further queries: Ping Me: Email Address
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.
The key features of Terraform are:
Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.
Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.
Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.
Change Automation: Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.
GitRepo: Terraform