- Newest
- Most votes
- Most comments
AWS End User Messaging Social with Custom WhatsApp Inbox
Architecture Validation
Your proposed architecture (EUM Social → SNS → Lambda → DynamoDB → Amplify APIs → React/Amplify UI) is a valid approach for building a custom WhatsApp inbox without Amazon Connect. This pattern aligns with AWS best practices for handling WhatsApp messaging through AWS End User Messaging Social.
EUM Social → SNS → Lambda → DynamoDB Pattern
This pattern is indeed recommended and supported by the EUM Social service for capturing both inbound WhatsApp messages and delivery/read/failure events. AWS End User Messaging Social is designed to publish messages and events to SNS topics, which can then trigger Lambda functions for processing.
For delivery semantics, you should assume at-least-once delivery with possible reordering. For idempotency, you should implement deduplication logic in your Lambda function using the message IDs provided in the EUM Social payload. Store these IDs in DynamoDB to prevent duplicate processing.
SNS Volume, Fan-out, and DLQs
Standard SNS topics are typically sufficient for EUM Social events. FIFO SNS would only be necessary if strict ordering per conversation is critical to your application logic.
For more resilient processing, consider using SNS → SQS → Lambda instead of SNS → Lambda directly. This pattern provides better buffering, backpressure handling, and independent retry capabilities.
For monitoring and error handling:
- Configure DLQs at both the SQS and Lambda levels
- Set up CloudWatch alarms for metrics like delivery failures, throttling events, and DLQ message counts
- Monitor SNS delivery success rates and Lambda execution errors
DynamoDB: Multi-tenant Design
Your single multi-tenant table approach with partition keys like tenantId#wabaId#phoneNumber is appropriate for this use case. This design follows DynamoDB best practices for multi-tenant applications.
For EUM Social payloads:
- Use conversation/session IDs from the payload for partition keys
- Message IDs are ideal for idempotency keys
- Customer phone numbers and WABA IDs can be used for joining messages, events, and customer entities
Amplify + React Inbox (Real-time & Security)
For near real-time updates, AppSync GraphQL with subscriptions on top of DynamoDB is the recommended approach when using Amplify. This provides a seamless real-time experience for your agent console.
Your security approach is correct:
- Backend Lambdas should be the only components calling EUM Social APIs
- The React client should only interact with authenticated APIs/GraphQL resolvers
- Never expose EUM Social APIs directly to the client
For multi-tenant authorization with Amplify + DynamoDB:
- Use Cognito user pools with custom attributes to store tenant information
- Implement authorization logic in your GraphQL resolvers or API Gateway authorizers
- Apply tenant-based filtering in your queries to ensure agents only see their tenant's data
WhatsApp Connect Sample Setup Issues
The sample you're referencing is designed to work with Amazon Connect, which may explain some of the deployment issues you're encountering since you're planning to adapt it to work without Connect. Some components may need significant modification to work with your Amplify-based approach.
If you're experiencing specific deployment issues with the sample, you might need to:
- Check for any region-specific dependencies in the CloudFormation templates
- Verify that all required permissions and IAM roles are correctly configured
- Ensure that your AWS account has the necessary service quotas and limits
Since you're planning to use only the EUM Social + backend patterns from this sample, you may need to extract and adapt those components rather than deploying the entire solution.
Sources
Automatización de flujos de trabajo con WhatsApp usando AWS End User Messaging Social | AWS Messaging Blog
Create a next generation chat assistant with Amazon Bedrock, Amazon Connect, Amazon Lex, LangChain, and WhatsApp | AWS Machine Learning Blog
Enhancing Message Reach: An Omnichannel Approach Using WhatsApp, SMS, and Email with AWS | AWS Messaging & Targeting Blog
For any specific queries related to any service, we require details that are non-public information. Please open a support case with respective AWS service using the following link.
Relevant content
asked 8 months ago
