Skip to content

Terraform automation to deploy Kafka on AWS

Notifications You must be signed in to change notification settings

kovihq/kafka-aws-deployment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kafka-aws-deployment

This project deploys Kafka and part of it's ecosystem to AWS through terraform.
It is mainly developed to help people that want to learn/explore the technology, focused - but not limited - to stream database events.

What is included:

Prerequisites

You need the following to deploy the project:

Usage

Before you deploy anything you need to make sure variables are set as expected on aws-infrastructure\configuration.
There are 5 configuration files where most variables are set with default values. However, there is a section on top of each file called NEED CONFIGURATION that needs your manual configuration.

Position on the root level of this project

Deploy:

Using Make

  • To deploy all of terraform

    make deploykad
  • To deploy VPC

    make deployvpc
  • To deploy MSK

    make deploymsk
  • To deploy ECS

    make deployecs

Manual Terraform

  • To deploy VPC

    cd aws-infrastructure/deployment/kad-vpc
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform apply -auto-approve -var-file="../../configuration/global-config.tfvars"
  • To deploy MSK

    cd aws-infrastructure/deployment/kad-msk
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform apply -auto-approve -var-file="../../configuration/global-config.tfvars" -var-file="../../configuration/msk-config.tfvars"
  • To deploy ECS

    cd aws-infrastructure/deployment/kad-ecs
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform apply -auto-approve -var-file="../../configuration/global-config.tfvars" -var-file="../../configuration/ecs-config.tfvars"

Destroy:

Using Make

  • To destroy all of terraform

    make destroykad

    kad = kafka aws deployment

  • To destroy ECS

    make destroyecs
  • To destroy MSK

    make destroymsk
  • To destroy VPC

    make destroyvpc

Manual Terraform

  • To destroy ECS

    cd aws-infrastructure/deployment/kad-ecs
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform destroy -auto-approve -var-file="../../configuration/global-config.tfvars" -var-file="../../configuration/ecs-config.tfvars"
  • To destroy MSK

    cd aws-infrastructure/deployment/kad-msk
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform destroy -auto-approve -var-file="../../configuration/global-config.tfvars" -var-file="../../configuration/msk-config.tfvars"
  • To destroy VPC

    cd aws-infrastructure/deployment/kad-vpc
    terraform init -backend-config="../../configuration/terraform-backend.tfvars"
    terraform destroy -auto-approve -var-file="../../configuration/global-config.tfvars"

AWS Architecture

Important Notes:

The architecture is designed for Kafka exploration and not a proper production deployment.

  • An autoscaling group is in place to facilitate the addition of new containers without worrying about the underlying infrastructure. You can change min, max and desired number of instances on this file aws-infrastructure\configuration\ecs-config.tfvars

ArchitectureImage

Example of Data Flow

DataFlowImage

About

Terraform automation to deploy Kafka on AWS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 95.1%
  • Makefile 4.9%