GithubHelp home page GithubHelp logo

vpc-ha-mzr's Introduction

Terraform automation script for an multi-zone region (MZR)

Description

This solution provides an automated solution for deploying a resilient infrastructure for a 3-tier web application in a MZR.

The code contains modules to deploy the following IBM Cloud resources:

  • VSIs
  • LBaaS (public or private)
  • subnets
  • security groups
  • VPN
  • public gateway
  • COS
  • User-data to install LAMP stack. (optional)

Some features are user choice to opt-in to allow some customization to best fit to their application requirements.

Architecture

The code is broken into two parts - core and optional modules. The core module is mandatory and consists of the following:

  • VSIs with anti-affinity (placement groups) for each tier -- web, app, and DB
  • DB has a secondary data volume.
  • Bastion server with a floating IP for management and access to other VSIs
  • Each tier is in their own private subnet with security groups.
  • Both web and app tiers are front-end with an LBaaS

The optional module, just as the name says it, it is an opt-in. The user can enable the following resources per their requirement:

  • Choice between public or private for the web LBaaS
  • VPN (site-to-site) for on-prem connectivity to the VPC
  • Autoscale to optimize VSI resource and cost for web and app tier.
  • COS for unstructured storage or backup
  • Public gateway for private subnets (web, app, and DB) for outbound traffic to the internet
  • LAMP stack installation

Input parameter file

Most edits are contained within the example.userinput.auto.tfvars file. You can enter the VSI image of choice or profile. The secondary data volume size parameter for DB is located in the db_variables.tf For resources listed as optional, you do not need to edit unless you have set it for true.

Security groups or LBaaS listening ports are configured with default ports (i.e., 22, 80, and 443). If additional modifications are required, then it is recommended to do it after provisioning through IBM Cloud UI or CLI.

Usage

  1. Clone the gh repo to your machine.
  2. Change directory to the location where you cloned the vpc-ha-az to.
  3. Edit the example.userinput.auto.tfvars.
    1. The default size for the data volume for DB is 10GB. To change the size edit the parameter in the db_variables.tf file.
  4. Issue terraform init.
  5. Issue terraform plan.
  6. Issue terraform apply.
  7. To destroy
    1. The bastion server is protected for inadvertent deletion. You need to change the prevent_destroy parameter to false. It is located at /.ha_saz_core_module/saz/core_modules/bastion_compute.tf.
    2. Issue terraform destroy.

Related Links

Customizing a three-tier highly available infrastructure VPC in a multi-zone region with automation

vpc-ha-mzr's People

Contributors

go-davidng avatar vkshrivastva 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.