- Project Description
- Project structure
- Dependencies
- Installation and startup
- Destroy
- AWS Diagrams
- State
- Tree
This project automates the deployment of infrastructure on Amazon Web Services (AWS) using Terraform for resource creation and Ansible for configuration. The infrastructure includes Nginx as a load balancer and Apache as a web server. Prior to usage, create a file <name>.tfvars
in the main folder and add the required parameters. Ensure that an AWS user with access to EC2, VPC, and SG is created using AMI.
- /: Terraform file directory.
main.tf
: Terraform core file with resource definition.vars.tf
: Terraform variables.secrets.tfvars
: Terraform secret Variables.nginx.tmpl
: Template for nginx configurations.template.tmpl
: Template for ansible inventory.change_permission.sh
: Change permission for keys./modules
: Modules for Terraform. In thesecrets.tfvars
, you need to specify the keys to the AWS user. Example:
access_key="your_value"
secret_key="your_value"
- /ansible: Catalog with Ansible configurations.
inventory/hosts
: File with hosts information.web.yml
: Ansible core playbook.source
: Folder for nginx and html.roles
: Ansible roulse.
Ensure the following tools are installed before usage:
git clone https://github.com/Mikitasz/StaticWebApp-AWS-TERRAFORM-ANISBLE-NGINX
cd StaticWebApp-AWS-TERRAFORM-ANISBLE-NGINX
terraform init
terraform plan -var-file=secrets.tfvars
terraform aply -var-file=secrets.tfvars
ansible-playbook -i ansible/inventory/hosts ansible/web.yaml
terraform destroy -var-file=secrets.tfvars
✅ Diagrams
✅ Terraform IaC
❌ Readability
✅ Ansible playbooks
❌ Autoscaling group
❌ CloudWatch
❌ Maximum automations
❌ Tests
✅ Final diagram
.
├── README.md
├── ansible
│ ├── inventory
│ ├── roles
│ ├── source
│ └── web.yaml
├── change_permission.sh
├── main.tf
├── modules
│ ├── ASG
│ ├── NAT
│ ├── ansible_inventory
│ ├── bastion
│ ├── create key-pair
│ ├── ec2
│ ├── internet_gateway
│ ├── nginx
│ ├── route
│ ├── sg
│ └── vpc
├── nginx.tmpl
├── secrets.tfvars
├── template.tmpl
├── terraform.tfstate
├── terraform.tfstate.backup
└── vars.tf