DEV Community

Said Olano
Said Olano

Posted on

What exactly does terraform apply do?

The terraform apply command is one of Terraform's main commands and is used to apply the necessary changes to your infrastructure based on the execution plan generated from the configuration files (.tf).

What exactly does terraform apply do?

Reads the configuration from Terraform files (*.tf or *.tf.json).

Compares the current state of the infrastructure (stored in the terraform.tfstate file) with the desired configuration.

Displays an execution plan showing which resources will be created, modified, or destroyed.

Prompts for confirmation (unless the -auto-approve flag is used).

Executes the necessary actions on the provider (such as AWS, Azure, GCP, etc.) to make the infrastructure match the configuration.

Top comments (0)