Skip to content

Commit

Permalink
chore: added lambda extra allowed triggers to allow other principal t…
Browse files Browse the repository at this point in the history
…o execute this SNS topic
  • Loading branch information
david tjokroaminoto committed Nov 22, 2024
1 parent 7e4df4f commit 4984d2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ module "lambda" {
dead_letter_target_arn = var.lambda_dead_letter_target_arn
attach_dead_letter_policy = var.lambda_attach_dead_letter_policy

allowed_triggers = {
allowed_triggers = merge({
AllowExecutionFromSNS = {
principal = "sns.amazonaws.com"
source_arn = local.sns_topic_arn
}
}
}, var.lambda_extra_allowed_triggers)

store_on_s3 = var.lambda_function_store_on_s3
s3_bucket = var.lambda_function_s3_bucket
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ variable "lambda_function_ephemeral_storage_size" {
default = 512
}

variable "lambda_extra_allowed_triggers" {
description = "To allow other resources to trigger this lambda"
type = map(any)
default = {}
}

variable "sns_topic_tags" {
description = "Additional tags for the SNS topic"
type = map(string)
Expand Down

0 comments on commit 4984d2b

Please sign in to comment.