Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cloudwatch decompression and data message extraction #12

Merged
merged 4 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
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
24 changes: 22 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ locals {
is_search_destination = contains(["elasticsearch", "opensearch", "opensearchserverless"], local.destination) ? true : false

# Data Transformation
enable_processing = var.enable_lambda_transform || var.enable_dynamic_partitioning
enable_processing = var.enable_lambda_transform || var.enable_dynamic_partitioning || var.enable_cloudwatch_logs_decompression
lambda_processor = var.enable_lambda_transform ? {
type = "Lambda"
parameters = [
@@ -97,11 +97,31 @@ locals {
record_deaggregation_processor = (var.enable_dynamic_partitioning && var.dynamic_partition_enable_record_deaggregation ?
(var.dynamic_partition_record_deaggregation_type == "JSON" ? local.record_deaggregation_processor_json : local.record_deaggregation_processor_delimiter)
: null)
cloudwatch_logs_decompression_processor = var.enable_cloudwatch_logs_decompression ? {
type = "Decompression"
parameters = [
{
name = "CompressionFormat"
value = var.cloudwatch_logs_compression_type
}
]
} : null
cloudwatch_logs_data_message_extraction_processor = var.enable_cloudwatch_logs_decompression && var.enable_cloudwatch_logs_data_message_extraction ? {
type = "CloudWatchLogProcessing"
parameters = [
{
name = "DataMessageExtraction"
value = tostring(var.enable_cloudwatch_logs_data_message_extraction)
},
]
} : null
processors = [for each in [
local.lambda_processor,
local.metadata_extractor_processor,
local.append_delimiter_processor,
local.record_deaggregation_processor
local.record_deaggregation_processor,
local.cloudwatch_logs_decompression_processor,
local.cloudwatch_logs_data_message_extraction_processor
] : each if local.enable_processing && each != null]

# Data Format conversion
22 changes: 22 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -433,6 +433,28 @@ variable "msk_source_connectivity_type" {
######
# S3 Destination Configurations
######
variable "enable_cloudwatch_logs_decompression" {
description = "Enables or disables Cloudwatch Logs decompression"
type = bool
default = false
}

variable "cloudwatch_logs_compression_type" {
tropnikovvl marked this conversation as resolved.
Show resolved Hide resolved
description = "Cloudwatch Logs decompression types"
type = string
default = "GZIP"
validation {
error_message = "Valid value is GZIP."
condition = contains(["GZIP"], var.cloudwatch_logs_compression_type)
}
}

variable "enable_cloudwatch_logs_data_message_extraction" {
description = "Cloudwatch Logs data message extraction"
type = bool
default = false
}

variable "enable_dynamic_partitioning" {
description = "Enables or disables dynamic partitioning"
type = bool