lambda-kinesis-to-fluent

baikonur-oss/lambda-kinesis-to-fluent/aws

Terraform Module HCL AWS ⏱ stale 5y 9mo

Terraform module and Lambda for sending logs from Kinesis to Fluent endpoint.

Install

module "lambda-kinesis-to-fluent" {
source = "baikonur-oss/lambda-kinesis-to-fluent/aws"
version = "0.1.0"
}
⭐ Source on GitHub 📦 Registry page

README

Amazon Kinesis to Fluent log transfer Terraform module Terraform module and Lambda for sending JSON log records from Kinesis Data Streams to a Fluent endpoint. !terraform v0.11.x Prerequisites 1. Records in Kinesis stream must be valid JSON data. Non-JSON data will be saved with unknown prefix. 1. gzipped JSON, CloudWatch Logs subscription filters log format are supported. 2. Logs without either of necessary keys listed below will be saved as unknown as well. 2. JSON data must have the following keys (key names are modifiable via variables): 1. log_type: Log type identifier. Failed logs will be saved by this key: %log_type%/YYYY-MM/DD/. 2. log_id: Any unique identifier. Used to avoid file overwrites on S3. Also is useful to search for a specific log record. 3. time: Any timestamp supported

Inputs (24)

NameTypeDescriptionDefault
batch_sizestringMaximum number of records passed for a single Lambda invocation required
security_group_idslistVPC Security group IDs required
failed_log_s3_bucketstringS3 bucket name for saving failed logs (ES API errors etc.) required
kinesis_stream_arnstringSource Kinesis Data Streams stream name required
subnet_idslistVPC Subnet IDs required
namestringResource name required
lambda_package_urlstringLambda package URL (see Usage in README) required
failed_log_s3_prefixstringPath prefix for failed logs required
fluent_sink_endpointstringTarget Fluent sink endpoint (IP or hostname) required
fluent_tagstringSecond-level fluent tag name (first level is log type) required
log_type_field_whitelistlistLog type whitelist (if empty, all types will be processed)[]
timeoutstringLambda Function timeout in seconds60
runtimestringLambda Function runtime"python3.7"
tracing_modestringX-Ray tracing mode (see: https://docs.aws.amazon.com/lambda/latest/dg/API_Tracin"PassThrough"
tagsmapTags for Lambda Function{}
log_retention_in_daysstringLambda Function log retention in days30
timezonestringtz database timezone name (e.g. Asia/Tokyo)"UTC"
memorystringLambda Function memory in megabytes256
log_type_fieldstringKey name for log type"log_type"
log_type_unknown_prefixstringLog type prefix for logs without log type field"unknown"
log_id_fieldstringKey name for unique log ID"log_id"
log_timestamp_fieldstringKey name for log timestamp"time"
handlerstringLambda Function handler (entrypoint)"main.handler"
starting_positionstringKinesis ShardIterator type (see: https://docs.aws.amazon.com/kinesis/latest/APIR"TRIM_HORIZON"

Resources (4)

aws_cloudwatch_log_groupaws_iam_role_policy_attachmentaws_lambda_event_source_mappingaws_lambda_function

Details

FrameworkTerraform Module
LanguageHCL
Version0.1.0
Cloud AWS
★ Stars0
Forks2
Total downloads6.5k
Inputs24
Resources4
LicenseMIT
Namespacebaikonur-oss
Updated