GithubHelp home page GithubHelp logo

l-monninger / terraform-google-consul Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hashicorp/terraform-google-consul

0.0 0.0 0.0 929 KB

A Terraform Module for how to run Consul on Google Cloud using Terraform and Packer

License: Apache License 2.0

Shell 39.56% Go 18.66% HCL 41.77%

terraform-google-consul's Introduction

DISCLAIMER: This is no longer supported.

Moving forward in the future this repository will be no longer supported and eventually lead to deprecation. Please use our latest versions of our products moving forward or alternatively you may fork the repository to continue use and development for your personal/business use.


Terraform Version

Consul for Google Cloud Platform (GCP)

This repo contains a Terraform Module for how to deploy a Consul cluster on GCP using Terraform. Consul is a distributed, highly-available tool that you can use for service discovery and key/value storage. A Consul cluster typically includes a small number of server nodes, which are responsible for being part of the consensus quorum, and a larger number of client nodes, which you typically run alongside your apps:

Consul architecture

How to use this Module

Each Module has the following folder structure:

  • modules: This folder contains the reusable code for this Module, broken down into one or more submodules.
  • examples: This folder contains examples of how to use the submodules.
  • test: Automated tests for the submodules and examples.

To deploy Consul servers using this Module:

  1. Create a Consul Image using a Packer template that references the install-consul module. Here is an example Packer template. Note that Google Cloud does not support custom public Images so you must build this Packer template on your own to proceed.

  2. Deploy that Image across a Compute Instance Group using the Terraform consul-cluster module and execute the run-consul script with the --server flag during boot on each Instance in the Compute Instance Group to form the Consul cluster. Here is an example Terraform configuration to provision a Consul cluster.

To deploy Consul clients using this Module:

  1. Use the install-consul module to install Consul alongside your application code.
  2. Before booting your app, execute the run-consul script with --client flag.
  3. Your app can now usr the local Consul agent for service discovery and key/value storage.
  4. Optionally, you can use the install-dnsmasq module to configure Consul as the DNS for a specific domain (e.g. .consul) so that URLs such as foo.service.consul resolve automatically to the IP address(es) for a service foo registered in Consul (all other domain names will be continue to resolve using the default resolver on the OS).

What's a Terraform Module?

A Terraform Module refers to a self-contained packages of Terraform configurations that are managed as a group. This repo is a Terraform Module and contains many "submodules" which can be composed together to create useful infrastructure patterns.

Who created this Module?

These modules were created by Gruntwork, in partnership with HashiCorp, in 2017 and maintained through 2021. They were deprecated in 2022, see the top of the README for details.

Code included in this Terraform Module:

  • install-consul: This module installs Consul using a Packer template to create a Consul Custom Image.

  • consul-cluster: The module includes Terraform code to deploy a Consul Image across a Managed Compute Instance Group.

  • run-consul: This module includes the scripts to configure and run Consul. It is used by the above Packer module at build-time to set configurations, and by the Terraform module at runtime with the Instance's Startup Script to create the cluster.

  • install-dnsmasq module: Install Dnsmasq and configure it to forward requests for a specific domain to Consul. This allows you to use Consul as a DNS server for URLs such as foo.service.consul.

How is this Terraform Module versioned?

This Terraform Module follows the principles of Semantic Versioning. You can find each new release, along with the changelog, in the Releases Page.

During initial development, the major version will be 0 (e.g., 0.x.y), which indicates the code does not yet have a stable API. Once we hit 1.0.0, we will make every effort to maintain a backwards compatible API and use the MAJOR, MINOR, and PATCH versions on each release to indicate any incompatibilities.

License

This code is released under the Apache 2.0 License. Please see LICENSE and NOTICE for more details.

Copyright © 2017 Gruntwork, Inc.

terraform-google-consul's People

Contributors

blaisep avatar brikis98 avatar dsdatsme avatar etiene avatar josh-padnick avatar l-monninger avatar madmod avatar madsonic avatar oralordos avatar robmorgan avatar strixbe avatar yorinasub17 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.