This Terraform configuration creates an EC2 instance on AWS with a root volume of 30 GB and sets up necessary
security groups and key pairs for SSH access. The instance is tagged as "ubuntu-server" and runs apt update
and apt upgrade
commands during initialization.
Before you begin, ensure you have the following installed:
- Terraform (version 0.12 or later)
- AWS CLI configured with your credentials
- Visual Studio Code (VS Code)
- Terraform VS Code Extension
-
Clone the Repository
git clone (https://github.com/amend07/terraform-aws/)
cd terraform-aws
-
Configure AWS Credentials Ensure your AWS CLI is configured with the necessary credentials:
aws configure
-
Initialize terraform Open the project directory in VS Code and run the following command in the integrated terminal to initialize Terraform:
terraform init
-
Plan the Infrastructure To see the changes that will be made by this configuration, run:
terraform plan
-
Apply the Configuration To create the EC2 instance and related resources, run:
terraform apply