Giter Club home page Giter Club logo

terraform-aws-logdna-cloudwatch's Introduction

terraform-aws-logdna-cloudwatch

Terraform Module to deploy the LogDNA Cloudwatch Lambda

A terraform module for deploying the LogDNA log integration lambda as described here: https://github.com/logdna/aws-cloudwatch

This module

  • deploys the labmda from the LogDNA Repo
  • Creates the required IAM resources

Required

  • service_identifier - service_identifier - Unique identifier for the app, used in naming resources. (ex: LogDNA-dev )
  • logdna_key - LogDNA Ingestion Key

Optional

  • logdna_hostname - LOGDNA_HOSTNAME Alternative Host Name - NOT YET Implemented
  • logdna_tags - List of tags to add to log DNA, current region is always added, region is always added to the array
  • reserved_concurrent_executions - Number of reserved concurrent executions (default 10)
  • url - URL to script content. (Defaults to GitHub Master : https://raw.githubusercontent.com/logdna/aws-cloudwatch/master/logdna_cloudwatch.py)

Usage

module "logdna` -
  source             = "github.com/asicsdigital/terraform-aws-logdna-cloudwatch.git"
  service_identifier = "LogDNA-dev"
  logdna_key         = "secret_key"
}

resource "aws_cloudwatch_log_subscription_filter" "logdna_lambdafunction_logfilter` -
  name            = "test_lambdafunction_logfilter"
  log_group_name  = "some-log-group-name"
  filter_pattern  = "" # This is required, but can be empty
  destination_arn = "${module.logdna.lambda_arn}"
}

resource "aws_lambda_permission" "allow_cloudwatch` -
  statement_id   = "AllowExecutionFromCloudWatch-${module.logdna.function_name}-${data.aws_region.current.name}"
  action         = "lambda:InvokeFunction"
  function_name  = "${module.logdna.function_name}"
  principal      = "logs.amazonaws.com"
  source_arn     = "arn:aws:logs:us-east-1:123456789012:log-group:some-log-group-name:*"
}

Outputs

  • script_body - Raw content of the script.
  • lambda_arn - arn of the aws_lambda_function resource
  • lambda_role_arn - arn of the aws_iam_role resource
  • function_name - function name of the aws_lambda_function resource

Authors

Tim Hartmann

License

MIT License

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.