This project provisions a secure HTTPS web application on AWS using Terraform. It deploys an Application Load Balancer (ALB) that distributes traffic to an Amazon EC2 instance running Nginx, secures the application with an existing AWS Certificate Manager (ACM) certificate, and exposes the application through a custom domain managed by Amazon Route 53.
The project demonstrates how to build a production-style HTTPS architecture while separating shared infrastructure resources, such as Route 53 and ACM, from application-specific infrastructure.
Internet
│
▼
Amazon Route 53
│
▼
AWS Certificate Manager
│
▼
Application Load Balancer (HTTPS)
│
▼
Target Group
│
▼
Amazon EC2 (Nginx)
- Amazon VPC
- Public Subnets
- Internet Gateway
- Route Tables
- Security Groups
- Amazon EC2
- Application Load Balancer (ALB)
- Target Group
- AWS Certificate Manager (ACM)
- Amazon Route 53
- Amazon S3 (Terraform Remote Backend)
- GitHub Actions (CI/CD)
- Provision infrastructure using Terraform.
- Deploy an internet-facing Application Load Balancer.
- Configure HTTPS using an existing ACM certificate.
- Route traffic through a custom Route 53 domain.
- Deploy an EC2 instance with Nginx using user data.
- Store Terraform state remotely in Amazon S3.
- Deploy infrastructure through GitHub Actions.
.
├── .github/
│ └── workflows/
├── backend.tf
├── provider.tf
├── variables.tf
├── outputs.tf
├── networking.tf
├── security.tf
├── compute.tf
├── loadbalancer.tf
├── route53.tf
├── userdata.sh
├── README.md
└── .gitignore
- Custom VPC
- Two public subnets
- Internet Gateway
- Public route table
- Route table associations
Two security groups are used:
Allows:
- HTTP (80)
- HTTPS (443)
from the Internet.
Allows:
- HTTP (80)
only from the ALB Security Group.
This project reuses an existing ACM certificate that was created and validated in a separate Terraform project.
The certificate is referenced using Terraform data sources instead of being recreated.
data "aws_acm_certificate" "main" {
domain = var.domain_name
statuses = ["ISSUED"]
most_recent = true
}The hosted zone is referenced as an existing resource.
Terraform creates only the DNS Alias record pointing the domain to the Application Load Balancer.
- Clone the repository.
- Configure AWS credentials.
- Initialize Terraform.
terraform init- Validate the configuration.
terraform validate- Review the execution plan.
terraform plan- Deploy the infrastructure.
terraform applyAfter deployment verify the following:
- HTTPS is accessible.
- SSL certificate is valid.
- Route 53 Alias record resolves correctly.
- ALB Target Group is healthy.
- EC2 instance is running.
- Nginx returns the application page.
The project provides:
- Website URL
- Application Load Balancer DNS Name
Infrastructure deployment is automated using GitHub Actions.
The workflow performs:
- Terraform Init
- Terraform Validate
- Terraform Plan
- Terraform Apply
AWS credentials are securely stored as GitHub Secrets.
This project reinforced several important Terraform and AWS concepts:
- Designing HTTPS architectures using ALB and ACM.
- Reusing shared infrastructure with Terraform data sources.
- Separating infrastructure ownership across projects.
- Using remote Terraform state in Amazon S3.
- Refactoring large Terraform configurations into modular files.
- Debugging Application Load Balancer target health.
- Understanding the difference between Terraform resources and data sources.
- Safely migrating Terraform state without destroying shared resources.
During development the following issues were identified and resolved:
- Terraform state migration between projects.
- Shared ACM certificate ownership.
- Route 53 resource ownership.
- ALB returning HTTP 503 due to missing target registration.
- Target Group attachment configuration.
- Security Group communication between ALB and EC2.
- HTTPS validation and DNS propagation.
Possible enhancements include:
- Auto Scaling Group
- Launch Template
- Multiple Availability Zones
- AWS WAF
- CloudFront
- AWS Systems Manager Session Manager
- CloudWatch monitoring and alarms
- AWS Backup
- Private subnets
- NAT Gateway
Recommended screenshots to include:
- Terraform Apply
- Route 53 Hosted Zone
- ACM Certificate (Issued)
- Application Load Balancer
- Target Group (Healthy)
- EC2 Instance
- HTTPS website
- GitHub Actions successful deployment
Terraform AWS Infrastructure Portfolio Project
Focus Areas:
- Infrastructure as Code
- Terraform
- Amazon Web Services
- Networking
- HTTPS
- Application Load Balancer
- Route 53
- GitHub Actions
Amazon Route 53 manages the DNS records for the custom domain and routes traffic to the Application Load Balancer.
The Application Load Balancer distributes incoming traffic across EC2 instances and terminates HTTPS connections using an ACM-issued certificate.
The load balancer redirects all HTTP traffic (port 80) to HTTPS (port 443). HTTPS requests are terminated using an AWS Certificate Manager (ACM) certificate and forwarded to the target group.
The application is hosted on an Amazon EC2 instance running Nginx. The instance is registered with the Application Load Balancer target group and successfully passes all health checks.



