Example of monitoring an SQS queue for messages that an attribute instance_id, which is set to your EC2 instance. The python subscriber can be used to monitor a shared SQS and act upon messages targeted at a specific instance id. #!/usr/bin/env python3 import boto3 import requests import subprocess import os import time boto3.setup_default_session(region_name="${aws.region}") sqs = boto3.resource('sqs') response = requests.get('http://169.254.169.254/latest/meta-data/instance-id') instance_id = response.text build_bucket = "${aws.s3.bucket}" # Retrieving a queue by