1 Answer
- Newest
- Most votes
- Most comments
0
Based on the information provided, here are several areas to check and debug:
-
Security Group Configuration:
- Ensure the Lambda Worker's security group allows outbound traffic specifically to port 5671 (AMQP with TLS)
- Verify the AmazonMQ broker's security group allows inbound traffic from the Lambda's security group on port 5671
-
Network Configuration:
- Confirm that both subnets used by the Lambda function have a route to the Amazon MQ broker
- Check if you have NAT Gateway configured for the private subnets if needed
- Verify that the VPC endpoints are properly configured
-
Broker Endpoint:
- Make sure you're using the SSL-enabled endpoint (port 5671) rather than the non-SSL endpoint
- Verify that the broker is in "Running" state
-
IAM Permissions:
- Add
mq:CreateEventSourceandmq:GetBrokerInstancespermissions to the Lambda execution role - Ensure the Lambda role has permissions to access the VPC resources
- Add
-
Event Source Mapping:
- Try deleting and recreating the event source mapping
- Verify the queue name is exactly correct (case-sensitive)
- Check if the credentials in Secrets Manager are correct and in the right format
-
Debugging Steps:
# Check broker connectivity aws mq describe-broker --broker-id your-broker-id # Check event source mapping status aws lambda get-event-source-mapping --uuid your-mapping-uuid # Check CloudWatch Logs for the Lambda function -
CloudWatch Metrics:
- Monitor the Lambda function's CloudWatch metrics for errors
- Check AmazonMQ CloudWatch metrics for connection issues
Since you mentioned that direct Pika connection works but the event source mapping doesn't, this suggests either:
- A permissions issue with the event source mapping
- A network configuration issue specific to the Lambda trigger
- An issue with the credentials format in Secrets Manager
answered a year ago
Relevant content
- AWS OFFICIALUpdated a month ago
