Giter Site home page Giter Site logo

forkkit / mattermost-cloud-database-factory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattermost/mattermost-cloud-database-factory

0.0 2.0 0.0 5.72 MB

License: Apache License 2.0

Makefile 4.20% Go 50.82% HCL 41.91% Dockerfile 1.95% Shell 1.12%

mattermost-cloud-database-factory's Introduction

Mattermost Cloud Database Factory

This repository houses the open-source components of Mattermost Cloud Database Factory. The database factory is a microservice with the purpose of deploying RDS Aurora Clusters via a API service.

For the configuration Terraform templates and modules are being used, preconfigured to meet Mattermost Cloud standards, but can be easily adapted to deploy RDS Aurora Clusters in any possible configuration. The database factory deploys and updates the RDS clusters.

Developing

Environment Setup

  1. Install Go
  2. Install Terraform version v0.11.14
  3. Specify the region in your AWS config, e.g. ~/.aws/config:
[profile mm-cloud]
region = us-east-1
  1. Generate an AWS Access and Secret key pair, then export them in your bash profile:
export AWS_ACCESS_KEY_ID=YOURACCESSKEYID
export AWS_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY
export AWS_PROFILE=mm-cloud
  1. Create an S3 bucket to store the terraform state
  2. Clone this repository into your GOPATH (or anywhere if you have Go Modules enabled)

Building

Simply run the following:

$ go install ./cmd/database-factory

Running

Run the server with:

$ dbfactory server

where dbfactory is an alias for /go/bin/dbfactory

Testing

Run the go tests to test:

$ go test ./...

Deploying RDS Aurora Clusters

Deploy a RDS Cluster with the command-line:

dbfactory cluster create --environment <environment> --vpc-id vpc-xxxxxx --state-store=<state_storage_bucket> --instance-type <db_instance_type> --apply

or via a API call:

{
    "vpcID": "",
    "environment": "",
    "stateStore": "",
    "apply": true,
    "instanceType": "",
    "clusterID": "",
    "backupRetentionPeriod" : ""
}

The clusterID value is important for determining how the database factory will behave. If not clusterID is passed in, a random 8-digit ID is generated. If a clusterID of an existing cluster is specified, Terraform will try to update the existing cluster configuration.

By setting apply to false or removing --apply, a Terraform plan will run, which can be used for Debug and testing purposes.

mattermost-cloud-database-factory's People

Contributors

cpanato avatar jwilander avatar stylianosrigas avatar

Watchers

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