diff --git a/modules/firehose/README.md b/modules/firehose/README.md
index f224d7c5..7322885c 100644
--- a/modules/firehose/README.md
+++ b/modules/firehose/README.md
@@ -185,7 +185,7 @@ then the CloudWatch metric stream must be configured with the same format, confi
| [logs_enable](#input\_logs_enable) | Enble sending logs to Coralogix | `bool` | `false` | no |
| [source_type_logs](#input\_source_type_logs) | The source_type of kinesis firehose: KinesisStreamAsSource or DirectPut | `string` | `DirectPut` | no |
| [kinesis_stream_arn](#input\_kinesis_stream_arn) | The kinesis stream name for the logs - used in kinesis stream as a source | `string` | `""` | no |
-| [kinesis_stream_arn](#input\_integration_type_logs) | The integration type of the firehose delivery stream: 'CloudWatch_JSON', 'WAF', 'CloudWatch_CloudTrail', 'EksFargate', 'Default', 'RawText' | `string` | `Default` | no |
+| [integration_type_logs](#input\_integration_type_logs) | The integration type of the firehose delivery stream: 'CloudWatch_JSON', 'WAF', 'CloudWatch_CloudTrail', 'EksFargate', 'Default', 'RawText' | `string` | `Default` | no |
| [dynamic_metadata_logs](#input\_dynamic_metadata_logs) | Dynamic values search for specific fields in the logs to populate the fields | `bool` | `false` | no |
diff --git a/modules/firehose/main.tf b/modules/firehose/main.tf
index 8b868188..feb43d4c 100644
--- a/modules/firehose/main.tf
+++ b/modules/firehose/main.tf
@@ -31,7 +31,6 @@ locals {
managed-by = "coralogix-terraform"
custom_endpoint = var.coralogix_firehose_custom_endpoint != null ? var.coralogix_firehose_custom_endpoint : ""
})
- application_name = var.application_name == null ? "coralogix-${var.firehose_stream}" : var.application_name
}
data "aws_caller_identity" "current_identity" {}
@@ -172,24 +171,36 @@ resource "aws_kinesis_firehose_delivery_stream" "coralogix_stream_logs_kinesis_s
request_configuration {
content_encoding = "GZIP"
- common_attributes {
- name = "integrationType"
- value = var.integration_type_logs
+ dynamic "common_attributes" {
+ for_each = var.integration_type_logs == null ? [] : [1]
+ content {
+ name = "integrationType"
+ value = var.integration_type_logs
+ }
}
- common_attributes {
- name = "applicationName"
- value = local.application_name
+ dynamic "common_attributes" {
+ for_each = var.application_name == null ? [] : [1]
+ content {
+ name = "applicationName"
+ value = var.application_name
+ }
}
- common_attributes {
- name = "subsystemName"
- value = var.subsystem_name
+ dynamic "common_attributes" {
+ for_each = var.subsystem_name == null ? [] : [1]
+ content {
+ name = "subsystemName"
+ value = var.subsystem_name
+ }
}
- common_attributes {
- name = "dynamicMetadata"
- value = var.dynamic_metadata_logs
+ dynamic "common_attributes" {
+ for_each = var.dynamic_metadata_logs == null ? [] : [1]
+ content {
+ name = "dynamicMetadata"
+ value = var.dynamic_metadata_logs
+ }
}
}
}
@@ -228,24 +239,36 @@ resource "aws_kinesis_firehose_delivery_stream" "coralogix_stream_logs_direct_pu
request_configuration {
content_encoding = "GZIP"
- common_attributes {
- name = "integrationType"
- value = var.integration_type_logs
+ dynamic "common_attributes" {
+ for_each = var.integration_type_logs == null ? [] : [1]
+ content {
+ name = "integrationType"
+ value = var.integration_type_logs
+ }
}
- common_attributes {
- name = "applicationName"
- value = local.application_name
+ dynamic "common_attributes" {
+ for_each = var.application_name == null ? [] : [1]
+ content {
+ name = "applicationName"
+ value = var.application_name
+ }
}
- common_attributes {
- name = "subsystemName"
- value = var.subsystem_name
+ dynamic "common_attributes" {
+ for_each = var.subsystem_name == null ? [] : [1]
+ content {
+ name = "subsystemName"
+ value = var.subsystem_name
+ }
}
- common_attributes {
- name = "dynamicMetadata"
- value = var.dynamic_metadata_logs
+ dynamic "common_attributes" {
+ for_each = var.dynamic_metadata_logs == null ? [] : [1]
+ content {
+ name = "dynamicMetadata"
+ value = var.dynamic_metadata_logs
+ }
}
}
}
@@ -464,14 +487,20 @@ resource "aws_kinesis_firehose_delivery_stream" "coralogix_stream_metrics" {
request_configuration {
content_encoding = "GZIP"
- common_attributes {
- name = "integrationType"
- value = var.integration_type_metrics
+ dynamic "common_attributes" {
+ for_each = var.integration_type_metrics == null ? [] : [1]
+ content {
+ name = "integrationType"
+ value = var.integration_type_metrics
+ }
}
- common_attributes {
- name = "applicationName"
- value = local.application_name
+ dynamic "common_attributes" {
+ for_each = var.application_name == null ? [] : [1]
+ content {
+ name = "applicationName"
+ value = var.application_name
+ }
}
}
diff --git a/modules/firehose/variables.tf b/modules/firehose/variables.tf
index 670fe2bd..b2a6450b 100644
--- a/modules/firehose/variables.tf
+++ b/modules/firehose/variables.tf
@@ -49,7 +49,7 @@ variable "output_format" {
variable "integration_type_metrics" {
description = "The integration type of the firehose delivery stream: 'CloudWatch_Metrics_JSON' or 'CloudWatch_Metrics_OpenTelemetry070'"
type = string
- default = "CloudWatch_Metrics_OpenTelemetry070"
+ default = ""
}
variable "application_name" {
@@ -61,7 +61,7 @@ variable "application_name" {
variable "subsystem_name" {
description = "The subsystem name of your application in Coralogix"
type = string
- default = ""
+ default = null
}
variable "user_supplied_tags" {
@@ -109,11 +109,11 @@ variable "kinesis_stream_arn" {
variable "integration_type_logs" {
description = "The integration type of the firehose delivery stream: 'CloudWatch_JSON', 'WAF', 'CloudWatch_CloudTrail', 'EksFargate', 'Default', 'RawText'"
type = string
- default = "Default"
+ default = null
}
variable "dynamic_metadata_logs" {
description = "Dynamic values search for specific fields in the logs to populate the fields"
type = bool
- default = false
+ default = null
}