skip to Main Content

Amazon web services – ElasticBeanstalk to handle script that runs only in 1 instance at the time

#!/bin/sh SQS_QUEUE_URL="url" AWS_REGION="eu-central-1" LOCK_KEY="supervisor-lock" # Unique identifier for the lock # Attempt to acquire the lock by sending a message to the queue lock_acquired=$(aws sqs send-message --queue-url "$SQS_QUEUE_URL" --region "$AWS_REGION" --message-body "$LOCK_KEY") echo "Lock Acquired: $lock_acquired" sleep 5 message=$(aws sqs…

VIEW QUESTION
Back To Top
Search