AWS SQS Logging Message Consumption

0

According to the referenced article the SQS supports the following logging actions (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-logging-using-cloudtrail.html):

AddPermission

CreateQueue

DeleteQueue

PurgeQueue

RemovePermission

SetQueueAttributes

TagQueue

UntagQueue

I have a requirement to log SQS API requests for the consumption of SQS queue messages? Is there a solution for this?

demandé il y a 2 ans320 vues
1 réponse
0
Réponse acceptée

No. SQS logs to CloudTrail the control plane APIs (as listed in your question). Consuming messages from a queue is a Data plane API, and only a few services (S3, DynamoDB and Lambda) support logging those messages to CloudTrail. SQS is not one of them.

If you need to log all those messages, do it in your application. Another option, that is relevant depending for the reason for the logging requirement, is to send the events to EventBridge and create a Rule with two targets. The first is the SQS queue. The second target is CloudWatch logs. This way all the messages will get to the application as well as to CWL.

profile pictureAWS
EXPERT
Uri
répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions