Skip to content

Commit 212c841

Browse files
docs: IAM permission clarification when using with encrypted SQS
1 parent c2ca9b3 commit 212c841

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/utilities/batch.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ This utility requires additional permissions to work as expected. Lambda functio
9393
If you are also using [nonRetryableExceptions](#move-non-retryable-messages-to-a-dead-letter-queue) attribute, utility will need additional permission of `sqs:GetQueueAttributes` on source SQS.
9494
It also needs `sqs:SendMessage` and `sqs:SendMessageBatch` on configured dead letter queue.
9595

96-
Refer [example project](https://github.com/aws-samples/aws-lambda-powertools-examples/blob/main/java/SqsBatchProcessing/template.yaml#L67) for policy details example.
96+
If source or dead letter queue is configured to use encryption at rest using [AWS Key Management Service (KMS)](https://aws.amazon.com/kms/), function will need additional permissions of
97+
`kms:GenerateDataKey` and `kms:Decrypt` on the KMS key being used for encryption. Refer [docs](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-key-management.html#compatibility-with-aws-services) for more details.
98+
99+
Refer [example project](https://github.com/aws-samples/aws-lambda-powertools-examples/blob/main/java/SqsBatchProcessing/template.yaml#L105) for policy details example.
100+
97101

98102
## Processing messages from SQS
99103

powertools-sqs/src/main/java/software/amazon/lambda/powertools/sqs/internal/BatchContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private boolean moveNonRetryableMessagesToDlqIfConfigured(Map<SQSMessage, Except
174174

175175
return sendMessageBatchResponses.stream()
176176
.filter(response -> null != response && response.hasFailed())
177-
.peek(sendMessageBatchResponse -> LOG.error("Failed sending message to the DLQ. Entire batch will be re processed. Check if need permissions are configured for the function. Response: {}", sendMessageBatchResponse))
177+
.peek(sendMessageBatchResponse -> LOG.error("Failed sending message to the DLQ. Entire batch will be re processed. Check if needed permissions are configured for the function. Response: {}", sendMessageBatchResponse))
178178
.count() == 0;
179179
}
180180

0 commit comments

Comments
 (0)