Code Monkey home page Code Monkey logo

infrastructure-on-aws-using-terraform-and-ansible's Introduction

Infrastructure on AWS using Terraform and Ansible

Table of Contents

Project Description

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.

Project structure

  • /: 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 the secrets.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.

Dependencies

Ensure the following tools are installed before usage:

Installation and startup

   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 

Destroy

   terraform destroy -var-file=secrets.tfvars

AWS Diagrams

s

Untitled Diagram drawio (8)

State

✅ Diagrams

✅ Terraform IaC

❌ Readability

✅ Ansible playbooks

❌ Autoscaling group

❌ CloudWatch

❌ Maximum automations

❌ Tests

✅ Final diagram

Tree

.
├── 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

infrastructure-on-aws-using-terraform-and-ansible's People

Contributors

mikitasz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.