The work here assumes you have an AWS account and have the AWS CLI installed and configured to this account.
- The variables.tf contains the different variables configurable in this example.
- The providers.tf contains the terraform providers needed for this example.
- The main.tf contains the configuration that Terraform will use to create the resources in the cloud.
- Initialize the Terraform configuration by running the following command
terraform init
- Plan the Terraform configuration by running the following command
terraform plan
- Apply the Terraform configuration by running the following command
# Run the following command to create the resources
terraform apply
# Run with a custom value to one of the variables
terraform apply -var 'instance_type=t3.medium'
- When you are done, you can destroy the resources by running the following command
terraform destroy