Coder Social home page Coder Social logo

terraform-ansible-wordpress's Introduction

This terraform projects creates RDS databse with mysql 5.7 #EC2 instance with wordpress pre installed and configured

AWS FREE TRIAL friendly

Change database entries ,regions and other variable in terraform.tfvars file And Database password in user.tfvars file

This script is only suitable for AWS LINUX 2 so make sure you have correct region and ami id in that region.

Make sure you have configured aws CLI in your local machine Ansible is installed in your local machine playbook_test.yml is a ansible script for LINUX 2

--------------------------------------------------------------------------------

Security:

EC2 will be launched in public subnet and RDS will be launched in private subnet

Only EC2 with defined security group can access RDS and RDS wont have internet access

<----------------------------------------------------------------------------------------------------------------------->

Prerequisite

Before launching Terraform template, aws cli should be installed and configured with proper access key and secret key

Terraform should be installed in your local machine

Ansible should be installed in youn local machine.

Configure AWS CLI with aws configure if you havent configured already

<------------------------------------------------------------------------------------------------------------------------>

STEPS:

Clone this repo using command git clone https://github.com/devbhusal/terraform-ansible-wordpress.git

Go to project folder cd terraform-ansible-wordpress

Initialize terraform terraform init

Change database and aws setting in terraform.tfvars file

Generate Key pair using ssh-keygen -f mykey-pair

View Plan using terraform plan -var-file="user.tfvars"

Apply the plan using terraform apply -var-file="user.tfvars"

After successfull provisioning of AWS Resources,Using remote-exec and private key, EC2 instance will be connected via SSH. Yum will be updated and Python will be installed so that local ansible server can communicate with the provisoned EC2 . Once Installation is done ,Using local exec , Ansible playbook will be run against provisioned EC2

everything is Automatic. This will provision all needed aws resources and also build and start webserver using Ansible

Destroy the resources terraform destroy -var-file="user.tfvars"

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.