Tuesday, November 15, 2016

amazon web services - Can I use AWS SNS to communicate between ECS Tasks?



I have an ECS Cluster which can scale some tasks in a service based on the load. I also have a scheduled audit ECS task which run periodically and wants to send a notification to these other tasks in the service so they can update their data set.



Can I use SNS to publish to a topic from the audit task and consume the notification in other tasks in the cluster? I'm able to publish to SNS but I don't see how notification would be received in other containers since subscriptions can only be http/email/sns/application/sqs etc.




The tasks are implemented in golang. I wanted to avoid adding a new message bus and am hoping aws has some framework for this.



Thanks


Answer



You can communicate between ECS containers using SNS.



Based on what little you've said you should consider Simple Queuing Service. If you need to send messages to multiple destinations it can be done with a combination of SNS and SQS.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...