Category: AWS
-
Monitoring a Synology Filesystem with AWS SQS
Use Case I would like to monitor events from a Synology NFS mount on another system. Solution Python module to monitor and forward filesystem events to an AWS SQS queue, that my external system can monitor and act upon Install Python 3 on Synology To do this, visit the Synology Package Center, search for “python”…
-
Short script to create and attach an EBS Volume in AWS
Short script for creating and attaching an EBS Volume to an EC2 instance. This is useful in cases where you want to dynamically create your EBS volumes outside of the cloud formation auto provisioning process.
-
Get Volume ID of a Volume, if it exists
volume_name=”Name of your volume” volume_id=`aws ec2 describe-volumes –filters Name=tag-key,Values=diskuse,Name=tag-value,Values=${volume_name} |jq -r –arg zone “$zone” ‘[.Volumes[] | select( (.State==”available”) and (.AvailabilityZone==$zone))][0] | .VolumeId’`
-
Set Message Attribute on SQS Message
Example on setting message attribute on SQS Message. Subscribers can perform actions based on the attributes. queue.send_message(MessageBody=json.dumps(instance), MessageAttributes={ ‘instance_id’: { ‘DataType’: ‘String’, ‘StringValue’: instance[‘InstanceId’] } } )