File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
examples/event-source-mapping Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,9 @@ module "lambda_function" {
27
27
event_source_arn = aws_sqs_queue.this.arn
28
28
}
29
29
dynamodb = {
30
- event_source_arn = aws_dynamodb_table.this.stream_arn
31
- starting_position = " LATEST"
32
- # This can be created but it won't be updated/removed. To be reviewed in the future.
33
- # destination_config = {
34
- # on_failure = {
35
- # destination_arn = aws_sqs_queue.failure.arn
36
- # }
37
- # }
30
+ event_source_arn = aws_dynamodb_table.this.stream_arn
31
+ starting_position = " LATEST"
32
+ destination_arn_on_failure = aws_sqs_queue.failure.arn
38
33
}
39
34
kinesis = {
40
35
event_source_arn = aws_kinesis_stream.this.arn
Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ resource "aws_lambda_permission" "unqualified_alias_triggers" {
213
213
}
214
214
215
215
resource "aws_lambda_event_source_mapping" "this" {
216
- for_each = var. create && var. create_function && ! var. create_layer && var. create_unqualified_alias_allowed_triggers ? var. event_source_mapping : tomap ({})
216
+ for_each = var. create && var. create_function && ! var. create_layer && var. create_unqualified_alias_allowed_triggers ? tomap ( var. event_source_mapping ) : tomap ({})
217
217
218
218
function_name = aws_lambda_function. this [0 ]. arn
219
219
@@ -229,15 +229,12 @@ resource "aws_lambda_event_source_mapping" "this" {
229
229
maximum_record_age_in_seconds = lookup (each. value , " maximum_record_age_in_seconds" , null )
230
230
bisect_batch_on_function_error = lookup (each. value , " bisect_batch_on_function_error" , null )
231
231
232
- /* @todo: fix this
233
232
dynamic "destination_config" {
234
- for_each = lookup(each.value, "destination_config", {})
235
-
233
+ for_each = lookup (each. value , " destination_arn_on_failure" , null ) != null ? [true ] : []
236
234
content {
237
235
on_failure {
238
- destination_arn = lookup(destination_config .value, "on_failure") #"destination_arn "]
236
+ destination_arn = each . value [ " destination_arn_on_failure " ]
239
237
}
240
238
}
241
239
}
242
- */
243
240
}
You can’t perform that action at this time.
0 commit comments