Skip to content

A Terraform project split for two state's that deploy Jenkins and Docker AWS environment.

Notifications You must be signed in to change notification settings

Levi-Michael/terraform-aws-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Terraform AWS Web Application Deployment

This project automates the deployment of a web application environment on AWS using Terraform. The infrastructure includes a Virtual Private Cloud (VPC) with multiple subnets, security groups, EC2 instances for Jenkins and Docker, an Application Load Balancer (ALB), and an Elastic Container Registry (ECR).

The architecture comprises:

  • VPC: Configured with public and private subnets to host resources securely.
  • Security Groups: Defined to control inbound and outbound traffic to AWS resources.
  • EC2 Instances:
    • Jenkins Server: For continuous integration and deployment tasks.
    • Docker Host: To run containerized applications.
  • Application Load Balancer (ALB): Distributes incoming application traffic across multiple targets, ensuring high availability.
  • Elastic Container Registry (ECR): A fully managed Docker container registry that makes it easy to store, manage, and deploy Docker container images.

Prerequisites

Before deploying this infrastructure, ensure you have the following:

  • AWS Account: Active account with sufficient permissions to create the necessary resources.
  • Terraform: Installed on your local machine.
  • AWS CLI: Configured with appropriate access credentials.
  • SSH Key Pair: An existing key pair in the target AWS region for EC2 instance access.

Deployment Steps

  1. Clone the Repository:

    git clone https://github.com/Levi-Michael/terraform-aws-web-app.git
    cd terraform-aws-web-app
  2. Initialize Terraform:

    terraform init
  3. Upgrade Terraform Providers (if necessary):

    terraform init -upgrade
  4. Review the Execution Plan:

    terraform plan
  5. Apply the Configuration:

    terraform apply

    Note: Review the changes and confirm the application when prompted.

Post-Deployment

After deployment:

  • Access Jenkins: Use the public DNS of the Jenkins EC2 instance to access the Jenkins dashboard.
  • Deploy Applications: Utilize the Docker host and ECR to manage and deploy your containerized applications.

Cleanup

To avoid incurring unnecessary charges, destroy the infrastructure when it's no longer needed:

terraform destroy

Ensure that you have backups of any important data before destroying the infrastructure.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.

Contact

Feel free to reach out for questions, collaboration opportunities or suggestions, open an issue or contact me directly through my GitHub profile.

About

A Terraform project split for two state's that deploy Jenkins and Docker AWS environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published