To see an example of this project in action, click here
NOTE: As of 3/30/22, this project is no longer using this infrastructure and has been migrated to a serverless version as hosted here
This repo contains all of the terraform configuration files needed to create a web server infrastructure on AWS to host a simple 'Online Guestbook' webapp:
- An EC2 Instance that will act as our web server
- A Virtual Private Cloud (VPC) for our web server to reside in
- A subnet to handle addressing within the VPC
- A routing table to handle routing between the VPC and the wider internet
- A security group to authorize traffic routing to and from the VPC
- All of which interface with Route53 to utilize the desired domain for name resolution/routing
All non-Route53 resources created as a result of this project are Free Tier-eligible (Route53 should cost ~$1.00 a month to operate, barring large amounts of traffic)
- AWS account with Power User privileges
- A pre-existing key pair. For info on creating one, please refer to this documentation from AWS
- terraform locally installed
- domain hosted via Route53 or any other DNS service
- Update the domain_name and instance_key variable in terraform.tfvars with your desired values (if Route53 DNS services are not desired, simply delete route53.tf)
- Ensure your AWS credentials are properly passed to your terminal session
- Apply the terraform configuration:
terraform init
terraform apply
NOTE: As part of the installation, your EC2 instance will utilize the files from the sister repository to configure the web server/app.
- Once complete, terraform will return the public IP address of your EC2 instance as the value of the web_instance_ip variable
post install, you may need to delegate DNS authority to the newly-created hosted zone. For more information, please refer to my blog post on how to do this