Created
June 20, 2020 18:36
-
-
Save DanielDaCosta/9dcdaee14c03464b0142abe1bcb3bd0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_lambda_permission" "allows_sqs_to_trigger_lambda" { | |
| statement_id = "AllowExecutionFromSQS" | |
| action = "lambda:InvokeFunction" | |
| function_name = aws_lambda_function.lambda_sqs.function_name | |
| principal = "sqs.amazonaws.com" | |
| source_arn = aws_sqs_queue.queue.arn | |
| } | |
| # Trigger lambda on message to SQS | |
| resource "aws_lambda_event_source_mapping" "event_source_mapping" { | |
| batch_size = 1 | |
| event_source_arn = aws_sqs_queue.queue.arn | |
| enabled = true | |
| function_name = aws_lambda_function.lambda_sqs.arn | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment