Home

Awesome

Zabbix (Docker) on AWS ECS with Terraform

Table of content

General

What is this?

This repository contains an easy to setup working zabbix HA cluster which runs on AWS ECS. The blogpost about this repository can be found here

AWS Stack

The following things are created when applying the terraform configuration:

Below is a visual representation about what will be created: AWS Stack

Installation

Tools

AWS Cli

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

Please see the manual on Amazon AWS on how to install aws-cli.

Docker

Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship new features faster, more securely and with confidence for both Linux and Windows Server apps.

Please see the manual on Docker on how to install docker and on how to run an example hello-world application.

Terraform

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

Please see the manual on Terraform on how to install terraform.

Application

Configuration

The following configuration settings can be set in the file variables.tfvars. See variables.tfvars.example as example.

Starting Up

Once you got all the tools installed we can start launching our zabbix infrastructure.

  1. Go inside the terraform folder and run terraform plan -var-file=variables.tfvars. This will give you an overview of what will be created.
  2. Run terraform apply -var-file=variables.tfvars to start creating the Amazon AWS recources.
  3. When everything is successful, You'll see output that will look like this:
Outputs:

Zabbix ECR Endpoint = 435551404480.dkr.ecr.eu-west-1.amazonaws.com/zabbix
Zabbix Endpoint = https://zabbix-1844418752.eu-west-1.elb.amazonaws.com
  1. AWS Setup is running. Now we need to deploy the docker image. Go inside the docker folder and execute aws ecr get-login --no-include-email --region eu-west-1

  2. The previous command will return an output that starts with docker login -u AWS -p Xeg...... Copy that entire output and execute it.

  3. Execute docker build -t zabbix . to start building the docker image

  4. Execute docker tag test:latest <Zabbix ECR Endpoint>:latest Replace <Zabbix ECR Endpoint> with the Zabbix ECR Endpoint received in step 3

  5. As a last step we need to push the docker image to our newly created repository. Execute docker push <Zabbix ECR Endpoint>:latest Replace <Zabbix ECR Endpoint> with the Zabbix ECR Endpoint received in step 3

  6. That's it! in a moment your zabbix cluster will come online on <Zabbix Endpoint> (See step 3).

If there are any issues, please do let me know!

License

The Zabbix (Docker) on AWS Terraform repository is licensed under the terms of the GPL Open Source license and is available for free.

Links