Skip to content

Commit

Permalink
Update MSK integration to accept multiple topics as a trigger [CDS-11…
Browse files Browse the repository at this point in the history
…08] (#149)

* update the msk integration to accept multiple topics

* update the changelog and readme
  • Loading branch information
guyrenny authored Mar 19, 2024
1 parent 0e744b1 commit 3ece97a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
### 💡 Enhancements 💡
- [cds-1099] add recombine operator to default configuration for opentelemetry ecs-ec2 integration

## v1.0.92
### 💡 Enhancements 💡
#### **coralogix-aws-shipper**
- allow MSK integration to get multiple topic names as a trigger

## v1.0.91
### 🚀 New components 🚀
#### **lambda-manager**
Expand Down
6 changes: 3 additions & 3 deletions examples/coralogix-aws-shipper/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ variable "cpu_arch" {
type = string
default = "arm64"
validation {
condition = contains(["arm64", "x86-64"], var.cpu_arch)
condition = contains(["arm64", "x86_64"], var.cpu_arch)
error_message = "The CPU architecture must be one of these values: [arm64, x86_64]."
}
}
Expand Down Expand Up @@ -229,8 +229,8 @@ variable "msk_cluster_arn" {
}

variable "msk_topic_name" {
description = "The name of the Kafka topic used to store records in your Kafka cluster"
type = string
description = "List of names of the Kafka topic used to store records in your Kafka cluster ( [\"topic1\", \"topic2\",])"
type = list
default = null
}

Expand Down
4 changes: 2 additions & 2 deletions modules/coralogix-aws-shipper/Msk.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ resource "aws_iam_role_policy_attachment" "msk-role-policy-attach" {
}

resource "aws_lambda_event_source_mapping" "msk_event_mapping" {
count = var.msk_cluster_arn != null ? 1 : 0
for_each = var.msk_topic_name != null ? toset(var.msk_topic_name) : toset([])
event_source_arn = var.msk_cluster_arn
depends_on = [module.lambda]
function_name = local.integration_info.integration.lambda_name == null ? module.locals.integration.function_name : local.integration_info.integration.lambda_name
starting_position = "LATEST"
topics = [var.msk_topic_name]
topics = [each.value]
}
2 changes: 1 addition & 1 deletion modules/coralogix-aws-shipper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ If you want to avoid this issue, you can deploy in other ways:
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_msk_cluster_arn"></a> [msk_cluster_arn](#input\_msk\_cluster\_arn) | The ARN of the MSK cluster to subscribe to retrieving messages.| `string` | n/a | yes |
| <a name="input_msk_topic_name"></a> [msk_topic_name](#input\_msk\_topic\_name) | The name of the Kafka topic used to store records in your Kafka cluster.| `string` | n/a | yes |
| <a name="input_msk_topic_name"></a> [msk_topic_name](#input\_msk\_topic\_name) | List of The Kafka topic anmes used to store records in your Kafka cluster [\"topic-name1\" ,\"topic-name2\"].| `list of strings` | n/a | yes |

### Kafka Configuration

Expand Down
4 changes: 2 additions & 2 deletions modules/coralogix-aws-shipper/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ variable "msk_cluster_arn" {
}

variable "msk_topic_name" {
description = "The name of the Kafka topic used to store records in your Kafka cluster"
type = string
description = "List of names of the Kafka topic used to store records in your Kafka cluster ( [\"topic1\", \"topic2\",])"
type = list
default = null
}

Expand Down

0 comments on commit 3ece97a

Please sign in to comment.