This project demonstrates how to launch an EC2 instance using Terraform within a Learner Lab environment.
Before starting, make sure you have:
- Terraform installed → Terraform Install Guide
- AWS credentials configured (via
aws configureor environment variables) - Access to a Learner Lab AWS account
- Basic knowledge of Terraform commands
git clone https://github.com/AJamell/TerraformPractice.git
cd TerraformPracticeCreate a terraform.tfvars file and add your AWS credentials and preferences:
aws_access_key = "YOUR_ACCESS_KEY"
aws_secret_key = "YOUR_SECRET_KEY"
region = "us-east-1"
key_name = "YOUR_KEY_PAIR_NAME"
instance_type = "t2.micro"Initialize your Terraform working directory and download the AWS provider plugin:
terraform initPreview the resources that Terraform will create:
terraform planApply your configuration to create the instance:
terraform applyTo clean up and avoid unnecessary charges:
terraform destroy