This repository contains Terraform scripts to deploy Amazon Linux 2023 and Windows Server 2019 instances on AWS. The configuration ensures that the instances are Free Tier Eligible and properly configured with security groups, key pairs, and storage options.
Before running Terraform, ensure you have:
- An AWS account
- Terraform installed (Download Here)
- AWS CLI installed (Download Here)
- Configured AWS credentials using:
aws configure
Here’s how to run the script on each platform:
- Give execute permissions to the script:
chmod +x SetUp_AWS_Terraform_Linux.sh
- Run the script:
./SetUp_AWS_Terraform_Linux.sh
-
Open PowerShell as Administrator
- Press
Win + X
, then click PowerShell (Admin) or Windows Terminal (Admin).
- Press
-
Allow script execution (only if needed):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
-
Run the script:
.\SetUp_AWS_Terraform_Windows.ps1
- Give execute permissions to the script:
chmod +x SetUp_AWS_Terraform_macOS.sh
- Run the script:
./SetUp_AWS_Terraform_macOS.sh
This will execute the Terraform setup and AWS CLI installation based on the OS. 🚀
- Architecture: 64-bit (x86)
- Instance Type:
t2.micro
- Storage: 8 GiB gp3 (3000 IOPS, not encrypted)
- Security Group: Allows SSH (22), HTTP (80), and HTTPS (443)
- Key Pair: Created and saved as
KeyPair.pem
- Architecture: 64-bit (x86)
- Instance Type:
t2.micro
- Storage: 30 GiB gp3 (3000 IOPS, not encrypted)
- Security Group: Allows RDP (3389), HTTP (80), and HTTPS (443)
- Key Pair: Created and saved as
KeyPair.ppk
- Architecture: 64-bit (x86)
- Instance Type:
t2.micro
- Storage: 8 GiB gp3 (3000 IOPS, not encrypted)
- Security Group: Allows SSH (22), HTTP (80), and HTTPS (443)
- Key Pair: Created and saved as
KeyPair.pem
- Pre-installed Software: Apache Web Server with index page setup
- Architecture: 64-bit (x86)
- Instance Type:
t2.micro
- Storage: 30 GiB gp3 (3000 IOPS, not encrypted)
- Security Group: Allows RDP (3389), HTTP (80), and HTTPS (443)
- Key Pair: Created and saved as
KeyPair.ppk
- Pre-installed Software: IIS Web Server with index page setup
terraform init
terraform fmt
terraform validate
terraform apply -auto-approve
terraform destroy -auto-approve
- Use PuTTYGen to convert
.pem
to.ppk
for Windows RDP:puttygen KeyPair.pem -o KeyPair.ppk
- Always check Free Tier limits to avoid unexpected charges.
- To manually delete resources, remove them from AWS Console.