This repository contains the infrastructure-as-code (IaC) code to provision resources on Amazon Web Services (AWS) using Terraform and configure them using Ansible.
The main objective is to configure a basic, secure, and functional infrastructure on AWS that includes:
- A Virtual Private Cloud (VPC).
- Two subnets: one Public and one Private.
- An Application Load Balancer (ALB) to distribute HTTP/HTTPS traffic.
- An EC2 instance in the Public Subnet to serve as a web server.
- Security Groups (SGs) to control network traffic (HTTP and SSH).
- Installation and configuration of the Nginx web server on the EC2 ( with Ubuntu Server ) instance using Ansible.
- main.tf : Create the basic structure
- inventory.tf : Use the public IP of the EC2 ( provide by the commando terraform apply && terraform output) and a previous configurated ssh key (Create locally) to acess and proceed to run the orders of install_nginx.yml
- install_nginx.yml: Check apt cache, install Nginx and run web server.