As we discussed in the Manipulating variables recipe in the previous chapter, we can also use the -var option of the terraform plan and apply commands to very easily increase or decrease the number of instances of this resource without having to modify the Terraform configuration.
In our case, for example, we could use the following plan and apply command:
terraform plan -var "nb_webapp=5"
However, with this option, we lose the benefits of IaC, which is the fact of writing everything in code and thus having a history of changes made to the infrastructure.
Moreover, it should be noted that lowering the nb_webapp value removes the last resources from the index, and it is not possible to remove resources that are in the middle of the index, which has been improved with the for_each expression that we will see in the Looping over object collections recipe in this chapter.
In addition, thanks to the count property we have just seen and...