Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Terraform Resources

This project provisions a small AWS environment with Terraform, configures the EC2 instance with Ansible, and includes a Jenkins pipeline for repeatable plan/apply/destroy workflows.

What it creates

  • A VPC with a public subnet, internet gateway, and route table
  • A security group for SSH, HTTP, and Jenkins-style web traffic
  • One Ubuntu EC2 instance prepared for Ansible management
  • One versioned S3 bucket with a unique suffix
  • An autogenerated Ansible inventory file after terraform apply

Project structure

  • terraform/: AWS infrastructure
  • ansible/: inventory, playbooks, and roles
  • jenkins/: CI/CD pipeline definition

Prerequisites

  • Terraform 1.5+
  • Ansible 2.14+
  • AWS CLI configured or Jenkins credentials exported as environment variables
  • An existing AWS key pair name for SSH access to the EC2 instance

Quick start

  1. Copy terraform/terraform.tfvars.example to terraform/terraform.tfvars
  2. Set values for aws_region, project_name, and key_pair_name
  3. Run:
cd terraform
terraform init
terraform plan
terraform apply
  1. After apply, run:
cd ..\ansible
ansible-playbook playbooks/bootstrap.yml

Terraform will generate ansible/inventory/hosts.ini automatically after a successful apply.

Jenkins usage

The pipeline in jenkins/Jenkinsfile supports:

  • plan
  • apply
  • destroy

The Jenkins agent should have Terraform and Ansible installed, plus AWS credentials available in the environment.

Notes

  • The default EC2 instance type is t3.micro
  • SSH access is restricted by allowed_ssh_cidr
  • The generated web page is a placeholder deployment to demonstrate automated server configuration

About

AWS DevOps automation repo using Terraform, Ansible, and Jenkins to provision AWS infrastructure, configure an Ubuntu EC2 web server, and manage repeatable deployment workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages