Skip to content

ferrindsouza/aws-terraform-intro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—οΈ Terraform on AWS β€” Deploying WordPress via Infrastructure as Code

πŸ“˜ Overview

This project showcases how to use Terraform to provision and manage AWS infrastructure through an automated, reusable IaC approach. As part of an AWS workshop, the deployment focuses on building a scalable WordPress application integrated with EC2, VPC, IAM, S3, and a MySQL database via RDS. The exercise highlights best practices in cloud architecture, security, and modular configuration using Terraform.


🎯 Objectives

  • Master Terraform fundamentals: providers, resources, state files, and variables
  • Provision infrastructure via modular configurations
  • Create IAM roles and policies following least-privilege principles
  • Set up networking layers with VPC, subnets, route tables, NATs, and internet gateways
  • Secure EC2 instance traffic using security groups
  • Host WordPress static assets in S3
  • Configure Amazon RDS for MySQL database hosting
  • Generate Terraform outputs for key application components
  • Validate successful WordPress deployment
  • Inspect and interpret Terraform state files for infrastructure drift and consistency

🧰 Tools & Technologies Used

Tool Description
Terraform Core infrastructure automation tool
AWS EC2 WordPress hosting via virtual machines
AWS VPC Virtual network isolation and traffic segmentation
AWS IAM Role-based access and permission management
AWS S3 Static asset storage and hosting
Amazon RDS Managed MySQL database service
Amazon EFS Shared storage for EC2 instances
Amazon SSM Systems management for infrastructure and software
AWS Secrets Manager Secure credentials and database password storage
Amazon ACM Certificate provisioning for secure HTTP (HTTPS)
Amazon CloudFront CDN integration for fast WordPress delivery

πŸ“ Project Structure

terraform-wordpress/
β”œβ”€β”€ main.tf
β”œβ”€β”€ variables.tf
β”œβ”€β”€ outputs.tf
β”œβ”€β”€ userdata/
β”‚   β”œβ”€β”€ staging-efs.sh
β”‚   β”œβ”€β”€ staging-wordpress.sh
β”œβ”€β”€ README.md

πŸ“Έ Architecture Overview

Architecture Diagram

πŸ”§ Setup & Installation

# Clone the project repository
git clone https://github.com/yourusername/terraform-wordpress.git
cd terraform-wordpress

# Initialize Terraform modules
terraform init

# Preview infrastructure changes
terraform plan

# Apply infrastructure deployment
terraform apply

πŸ’‘ Note: Ensure your AWS CLI is configured and your credentials have appropriate IAM permissions. This demo used administrative access for provisioning.


🧠 Key Learnings

  • Strengthened understanding of AWS infrastructure via modular Terraform scripting
  • Practiced secure networking through VPC subnets, NAT gateways, and security groups
  • Created IAM profiles for scoped EC2 and S3 access
  • Automated provisioning of WordPress infrastructure
  • Applied best practices in state file inspection and resource validation

πŸ“Š Terraform Outputs & Verification

πŸ“Œ IAM Resource Creation

IAM Creation

🌐 VPC & Networking

  • VPC Creation
    VPC Creation VPC Details

  • Subnet Configuration
    Subnets

  • Route Tables
    Route Tables

  • Internet Gateway
    Internet Gateway

  • NAT Gateway
    NAT Gateway

πŸ” Security Resources

  • Security Groups
    Security Group Plan Security Group Details

  • VPC Endpoints
    Endpoints

πŸ“¦ Application Outputs

Terraform Application Output

🌐 Application Verification

WordPress Webpage

πŸ“„ License

This project is licensed under the MIT License.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published