How to initialize Terraform The workflow used in a Terraform project is as follows:
Init: Initialization of the project.
terraform init
Plan: Planning of the resources defined in the code.
terraform plan
Apply: Deployment of the resources defined in the code.
terraform apply
Destroy: Destruction of the resources defined in the code (if necessary).
terraform destroy
Important: To run the project locally and be able to carry out the deployment, export the following variables by console with your AWS user credentials
export AWS_ACCESS_KEY_ID = "ID"
export AWS_SECRET_ACCESS_KEY = "SECRET_KEY"
. ./buildinfra.sh
. ./destoryinfra.sh