Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/s3-logfile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module "s3_processor" {

environment_variables = {
PARSER_TYPE = var.parser_type
REGEX_PATTERN = var.regex_pattern
FORCE_GUNZIP = true
ENVIRONMENT = var.environment
HONEYCOMB_WRITE_KEY = var.honeycomb_api_key
Expand Down
11 changes: 9 additions & 2 deletions modules/s3-logfile/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,18 @@ variable "parser_type" {
description = "The type of logfile to parse."
validation {
// ref: https://github.com/honeycombio/agentless-integrations-for-aws/blob/5f530c296035c61067a6a418d6a9ab14d34d7d79/common/common.go#L129-L153
condition = contains(["alb", "elb", "s3-access", "vpc-flow", "cloudfront", "json", "keyval"], var.parser_type)
error_message = "parser_type must be one of the allowed values"
condition = contains(["alb", "elb", "s3-access", "vpc-flow", "cloudfront", "json", "keyval", "regex"], var.parser_type)
error_message = "parser_type must be one of the allowed values."
}
}

variable "regex_pattern" {
# This variable depends on "parser_type". In tf < 1.9, validation cannot use another variable.
type = string
description = "Arbitrary regex pattern used to parse logfile. parser_type must be set to regex for this pattern to be used. Honeycomb columns are generated by defining named capture groups. For example, `(?P<name>[a-z]+)` would create a column called 'name' if successfully parsed."
default = ""
}

variable "rename_fields" {
type = map(string)
description = "Map of fields to rename, old -> new."
Expand Down