- 最新
- 投票最多
- 评论最多
Option 1: Cognito Trigger Use a Cognito trigger such as CustomMessage or another suitable trigger for updating user attributes. However, Cognito does not have a dedicated trigger specifically for user attribute updates.
Option 2: API Gateway and Lambda Create an API endpoint using API Gateway that triggers a Lambda function to handle the update logic. This approach would involve:Users making update requests through your application .The request hitting the API Gateway endpoint. The Lambda function being invoked to update both Cognito user attributes and the corresponding RDS record.
Proposed Approach: Given your requirements, the API Gateway and Lambda approach is more robust and follows best practices:
API Gateway: Expose an endpoint for user attribute updates. Secure the endpoint using AWS Cognito Authorizer. Lambda Function:
Verify the user’s identity and update the attributes in Cognito. Update the corresponding user record in the RDS database. Benefits: Centralized Logic: All update logic is centralized in a single Lambda function, making it easier to maintain and extend. Flexibility: Easy to implement additional checks or business logic during the update process. Security: The API Gateway can leverage Cognito for secure and authenticated requests.
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
Thank you for your detailed reply!
You are welcome