Skip to content
Draft
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/coralogix-aws-shipper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ If you're deploying multiple integrations through the same S3 bucket, you'll nee
| <a name="input_sns_topic_name"></a> [sns_topic_name](#input\_sns\_topic\_name) | The SNS topic containing the SNS subscription. You need this only when using the SNS integration. | `string` | n/a | yes |
| <a name="input_sns_topic_filter"></a> [sns_topic_filter](#input\_sns\_topic\_filter) | Map of filters to add to the SNS topic Lambda subscription. | `map(any)` | n/a | no |
| <a name="input_sns_topic_filter_policy_scope"></a> [sns_topic_filter_policy_scope](#input\_sns\_topic\_filter\_policy\_scope) | The scope of the filter policy for the SNS topic Lambda subscription, could be `MessageAttributes` or `MessageBody` | `string` | n/a | no |
| <a name="input_sns_topic_kms_key_id"></a> [sns_topic_kms_key_id](#input\_sns\_topic\_kms\_key\_id) | The ID of the KMS key used to encrypt the SNS topic. If not specified, the default AWS managed KMS key will be used | `string` | `alias/aws/sns` | no |
| <a name="input_create_sns_topic_policy"></a> [create_sns_topic_policy](#input\_create\_sns\_topic\_policy) | Whether to create and manage the SNS topic policy. Set to false if you want to manage the policy yourself and preserve existing permissions. | `bool` | `true` | no |

<!-- /description -->
Expand Down
9 changes: 5 additions & 4 deletions modules/coralogix-aws-shipper/Sns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ resource "aws_s3_bucket_notification" "topic_notification" {
}

resource "aws_sns_topic" "this" {
for_each = var.notification_email == null ? {} : var.integration_info != null ? var.integration_info : local.integration_info
name_prefix = each.value.lambda_name == null ? "${module.locals[each.key].function_name}-Failure" : "${each.value.lambda_name}-Failure"
display_name = each.value.lambda_name == null ? "${module.locals[each.key].function_name}-Failure" : "${each.value.lambda_name}-Failure"
tags = merge(var.tags, module.locals[each.key].tags)
for_each = var.notification_email == null ? {} : var.integration_info != null ? var.integration_info : local.integration_info
name_prefix = each.value.lambda_name == null ? "${module.locals[each.key].function_name}-Failure" : "${each.value.lambda_name}-Failure"
display_name = each.value.lambda_name == null ? "${module.locals[each.key].function_name}-Failure" : "${each.value.lambda_name}-Failure"
kms_master_key_id = var.sns_topic_kms_key_id
tags = merge(var.tags, module.locals[each.key].tags)
}

resource "aws_sns_topic_subscription" "lambda_sns_subscription" {
Expand Down
7 changes: 6 additions & 1 deletion modules/coralogix-aws-shipper/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,19 @@ variable "sns_topic_filter_policy_scope" {
default = null
}

variable "sns_topic_kms_key_id" {
description = "The ID of the KMS key used to encrypt the SNS topic. If not specified, the default AWS managed KMS key will be used"
type = string
default = "alias/aws/sns"
}

variable "create_sns_topic_policy" {
description = "Whether to create and manage the SNS topic policy. Set to false if you want to manage the policy yourself and preserve existing permissions. See README for required permissions when using custom policy."
type = bool
default = true
}

# vpc variables

variable "subnet_ids" {
description = "ID of Subnet into which to deploy the integration"
type = list(string)
Expand Down
Loading