A backend defines where Terraform stores its state data files. This folder is used to setup a remote backend for the infrastructure Terraform code of the EC2 instance. The state files are stored in a S3 bucket, and the lock synchronization is implemented with a Dynamo DB table.
Terraform is required to run the following instructions. It can be installed, or used from Docker.
# Always required:
export AWS_ACCESS_KEY_ID="AFG..."
export AWS_SECRET_ACCESS_KEY="ASR..."
# May be necessary:
export AWS_SESSION_TOKEN="WIo..."
terraform init
terraform apply
terraform destroy