Purpose of SQS Queues in Docker for AWS

This isn’t really a problem as it is a question:

What is the purpose of the SQS queues in the cloud formation template? If the swarm managers are handling orchestration, what would be the purpose of the queues?

The queues are used as part of the upgrade process: When AWS replaces an instance, the instance can learn of its impending doom and gracefully exit itself from the swarm and manager quorum.

Looking for docker for aws internal documentation. Would like to know how the components are working including sqs and dynamo db

After digging the aws template for a while found out dynamo db is being used to store primary manager ip address.

Yes and SQS is used to notify a node that is going down. There is a lifecycle hook in the ASG that puts a message on SQS about it, all nodes run a guide-aws contianer that runs a task every 1 minute to check the queue and demote/deregister and shutdown if they get the message to do so.

Similar script: