Giter Club home page Giter Club logo

companieshouse.prometheus-terraform's Introduction

prometheus-terraform

This project is comprised of a terraform script which when run will create the necessary infrastructure for a prometheus instance

Prerequisites

AWS Credentials

AWS credentials are selected based on the value of the AWS_PROFILE environmental variable and AWS CLI profile configuration. It is not possible to run the Terraform scripts without this variable set. Either export this in your current shell environment or permanently add it to your ~/.bash_profile or equivalent.

Terraform

These scripts make use of Infrastructure as Code (IaC) and depend on Terraform as the primary tool for managing and applying infrastructural changes. Documentation can be found for this tool on the Terraform Guides webpage.

Configuration

Terraform Variables

The following variables are required:

Variable Description Examples
aws_region AWS region to create the infrastructure eu-west-2
environment AWS environment in which to create the infrastructure development
instance_count How many instances you want 1
private_key_path The path of your private ssh key "~/.mysshkey"
prometheus_metrics_port The desired port 9999
ssh_keyname The keyname of the ssh profile you want to use my-environment
tag_name_regex Prometheus tag my-instance-tag
dns_zone_id The DNS zone id you want to use 12345
dns_zone_name The DNS zone name you want to use myzone.abc.com

State

Terraform state is stored remotely in an S3 bucket. The region, state bucket name, and workspace prefix are determined dynamically based on the configuration of the host environment and the AWS_PROFILE environment variable.

Environment-specific configuration

Environment-specific configuration tasks are performed after instance launch using cloud-init directives from user data. Terraform templates have been setup for individual files that require provisioning after instance launch and suitable variable interpolations have been added where required.

The following structure has been implemented for cloud-init configuration for each applicable Terraform module:

groups
  ├── prometheus
  │    ├── module-prometheus       - directory for EC2 configuration, including cloud-init
  │    │    ├── cloud-init         
  │    │    │   ├── files          - directory for YAML files that contain no variable interpolations
  │    │    │   └── templates      - directory for templates that include variable interpolations
  │    │    ├── cloud-init.tf      - main cloud-init configuration definition for this module
  │    │    ├── ec2.tf             - configuration file for ec2 instances
  │    │    ├── route53.tf         - configuration file for route 53 records
  │    │    ├── security-groups.tf - configuration file for security groups
  │    │    └── variables          - module variables definitions
  │    └── profiles                - folder for profile configuration  
  └── ...


## Applying infrastructure changes

The Prometheus-terraform scripts can be run using the Terraform-runner.

View usage instructions for the terraform-runner on the internal Confluence site

companieshouse.prometheus-terraform's People

Contributors

c-hadfield avatar gareth-e avatar jata2k 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.