Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform AWS training lab

Small public VPC with one EC2 instance in us-east-1. Terraform creates only the network and compute pieces listed in requirements.md.

What this creates

  • VPC 10.10.0.0/16
  • Public subnet 10.10.1.0/24
  • Internet Gateway
  • Public route table with 0.0.0.0/0 to the IGW
  • Security group allowing SSH from ssh_cidr
  • One t3.micro Amazon Linux 2023 instance with a public IP (not an Elastic IP)

It does not create a NAT Gateway, RDS, EKS, load balancer, or Elastic IP.

Prerequisites

  • Terraform >= 1.6.0
  • AWS credentials configured locally (environment variables, AWS CLI profile, or similar)
  • Permission to create VPC, subnet, IGW, route table, security group, and EC2 in us-east-1

Do not put access keys in Terraform files. Credentials stay in your environment or AWS profile.

Configure

Edit terraform.tfvars:

  • ssh_cidr — prefer your public IP as x.x.x.x/32 instead of 0.0.0.0/0
  • key_name — optional. Only set this if the key pair already exists in us-east-1. Leave it unset to launch without a key pair and use EC2 Instance Connect from the console or AWS CLI (no extra AWS resources required)

The AMI is resolved at plan/apply time from the AWS SSM public parameter:

/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-x86_64

Commands

terraform init
terraform plan
terraform apply

This repository does not run apply for you. Destroy the stack when you are done:

terraform destroy

SSH

If you set key_name:

ssh -i <your-private-key.pem> ec2-user@<instance_public_ip>

instance_public_ip is a Terraform output after apply.

About

Build Cloud Infrastructure with Terraform + Claude Code

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages