Giter Site home page Giter Site logo

terraform-ec2-rds-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 default for Ubuntu
If you want to configure wordpress in AWS LINUX 2 then change IsUbuntu value to false in terraform.tfvars

Make sure you have configured aws CLI in your local machine

user_data.tf is script for LINUX 2 and userdata_ubuntu.tpl is for Ubuntu

ami-id will be imported using data.aws_ami

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

Password for RDS will be used to create the resource, later it should be changed manually for security purposes. Terraform will ignore any changes in password

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

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

Configure AWS CLI with aws configure if you havent configured already

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

STEPS:

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

Go to project folder cd terraform-ec2-RDS-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

Apply the plan using terraform apply

After successfull provisioning of AWS Resources,Using remote-exec and private key, EC2 instance will be connected via SSH. Tail command will used to check prgress of Wordpress Installation. Once Installation is done ,You will be provided with Public Ip address of WebServer.

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

Destroy the resources terraform destroy

terraform-ec2-rds-wordpress's People

Contributors

devbhusal 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.