lambda-kinesis-to-s3

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

Terraform Module HCL AWS ⏱ stale 5y 5mo

Terraform module and Lambda for Kinesis to S3 logs transfer

Install

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

README

Amazon Kinesis to S3 log transfer Terraform module Terraform module and Lambda for saving JSON log records from Kinesis Data Streams to S3. !terraform v0.12.x ![Language grade: Python](https://lgtm.com/projects/g/baikonur-oss/terraform-aws-lambda-kinesis-to-s3/context:python) 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. Log data will be saved by this key: %log_type%/YYYY-MM/DD/. 2. log_id: Any unique identifier. Used to avoid file overwri

Inputs (20)

NameTypeDescriptionDefault
batch_sizestringMaximum number of records passed for a single Lambda invocation required
log_path_prefixstringLog file path prefix required
lambda_package_urlstringLambda package URL (see Usage in README) required
kinesis_stream_arnstringSource Kinesis Data Streams stream name required
namestringResource name required
log_bucketstringTarget S3 bucket to save data to required
log_type_unknown_prefixstringLog type prefix for logs without log type field"unknown"
log_retention_in_daysstringLambda Function log retention in days30
timezonestringtz database timezone name (e.g. Asia/Tokyo)"UTC"
timeoutstringLambda Function timeout in seconds60
starting_positionstringKinesis ShardIterator type (see: https://docs.aws.amazon.com/kinesis/latest/APIR"TRIM_HORIZON"
log_type_fieldstringKey name for log type"log_type"
log_type_field_whitelistlist(string)Log type whitelist (if empty, all types will be processed)[]
runtimestringLambda Function runtime"python3.7"
log_timestamp_fieldstringKey name for log timestamp"time"
tagsmap(string)Tags for Lambda Function{}
memorystringLambda Function memory in megabytes256
handlerstringLambda Function handler (entrypoint)"main.handler"
log_id_fieldstringKey name for unique log ID"log_id"
tracing_modestringX-Ray tracing mode (see: https://docs.aws.amazon.com/lambda/latest/dg/API_Tracin"PassThrough"

Resources (4)

aws_cloudwatch_log_groupaws_iam_role_policy_attachmentaws_lambda_event_source_mappingaws_lambda_function

Details

FrameworkTerraform Module
LanguageHCL
Version2.1.1
Cloud AWS
★ Stars4
Forks3
Total downloads8.9k
Inputs20
Resources4
LicenseMIT
Namespacebaikonur-oss
Updated