Skip to content

jegadeshhike/sch-elk-orchestration

 
 

Repository files navigation

Build Status

sch-elk-orchestration

High-level Description

  • Prepares the IAM roles; sets their permission and trust policies as defined in the iam_policies folder
  • Prepares the custom monitoring scripts and uploads them to S3
  • Prepares the Chef cookbooks for use in OpsWorks
  • Creates the OpsWorks stack
  • Creates the Data Pipeline for scheduled batch uploads
  • Creates Cloudwatch alarm for the ELK Pipeline

Prerequisites

  • AWSCLI installed and configured

  • Git installed and configured

  • Chef-DK installed and configured

  • Parts of the ELK System already in place:

    • Logstash Buffer Custom CloudWatch Metric
    • S3 bucket/path of the logs to be processed by Shipper
  • Prepare the following:

    • SNS Topic ARN used for notification
    • S3 bucket/path created where custom scripts will be stored
    • S3 bucket/path created where DataPipeline will store logs

Usage

  1. Download the code.

git clone https://github.com/SCH-CISM/sch-elk-orchestration.git

  1. Prepare the Chef cookbooks

cd .\cookbooks; berks package elk-cookbooks.tar.gz; cd ..

  1. Upload the Chef cookbooks to s3

aws s3 cp .\cookbooks\elk-cookbooks.tar.gz s3://YOURBUCKET/cookbooks/ --sse

  1. Upload the contents of custom_scripts to the bin directory of your infrastructure bucket.

aws s3 cp .\custom_scripts\ s3://YOURBUCKET/bin --recursive --sse

  1. Upload the cloudformation templates to the cloudformation directory of your infrastructure bucket.

aws s3 cp .\cloudformation\ s3://YOURBUCKET/cloudformation --recursive --sse

  1. Create the IAM roles

aws cloudformation --stack-name STACKNAME --template-url https://s3-us-west-2.amazonaws.com/YOURBUCKET/cloudformation/elk-iam-roles.json --parmaeters ParameterKey=MaxMindLicenseKey,ParameterValue=YOURKEYSTRING

  1. Create the ELK OpsWorks stack

aws cloudformation --stack-name STACKNAME --template-url https://s3-us-west-2.amazonaws.com/YOURBUCKET/cloudformation/elk-opsworks-stack.json --parmaeters ParameterKey=MaxMindLicenseKey,ParameterValue=YOURKEYSTRING

  1. Get the layer IDs for the newly created stack

aws opsworks describe-layers --stack-id STACKID --region us-east-1 | C:\localbin\jq.exe ".Layers[] | {LayerId, Name}"

  1. Launch the instances in the ES and KB layers

  2. Create the ELK pipeline

aws cloudformation --stack-name STACKNAME --template-url https://s3-us-west-2.amazonaws.com/YOURBUCKET/cloudformation/elk-opsworks-stack.json --parmaeters ParameterKey=OpsworksShipperLayerID,ParameterValue=LSLAYERID,ParameterKey=OpsworksIndexerLayerID,ParameterValue=LSIXLAYERID,ParameterKey=OpsworksRedisLayerID,ParameterValue=RSLAYERID

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.1%
  • Ruby 3.9%