Giter VIP home page Giter VIP logo

ubuntu-lamp-terraform-script's Introduction

Terraform: Deploy A LAMP Stack In AWS

This script will deploy a Ubuntu (22.xx) and install *

  • Apache2
  • MariaDB
  • PHP
  • phpmyadmin

Make the following changes in script to make it work for you.

Edit variables.tf

Choose Region

variable "region" {
  default = "us-west-2"
}

This picks up saved AWS Credentials in your AWS cli locally, check with command aws configure list, check documentation in this link https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

variable "profile" {
  type    = string
  default = "phporegon123"
}

The aws key that needs to be used for AWS Instance creation. This should be pre-exist in the region, so create it and update the name here.

variable "private_key" {
  default = "AWS-dev-key"
}

This will add the tags to all resources created for identification.

variable "project_name" {
  default = "Terraform from Izumo"
}

Enviroment, Dev or Prod

variable "project_environment" {
  default = "dev"
}

Edit ubuntu-lamp-install.sh

Edit the passwords in the ubuntu-lamp-install.sh in line 54,56 for mariaDB root password

sudo debconf-set-selections<<<"mariadb-server mysql-server/root_password password Rotxerd689!"
sudo debconf-set-selections<<<"mariadb-server mysql-server/root_password_again password Rotxerd689!" 

and 97,98 for phpmyadmin user mariaadmin password.

CREATE USER 'mariaadmin'@localhost IDENTIFIED BY 'Pxcyt268!';
GRANT ALL PRIVILEGES ON *.* TO 'mariaadmin'@localhost IDENTIFIED BY 'Pxcyt268!';

Format code

terraform fmt

Initialize terraform (downloads provider [AWS] packages)

terraform init

Create resource

terraform apply

ubuntu-lamp-terraform-script's People

Contributors

mkpathcreate avatar

Stargazers

 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.