This container subscribes to an SQS queue and downloads S3 links posted there to send them to a network printer with pdf-to-ipp
docker run \
-e "DESTINATION=http://pdf-to-ipp.thuis/uploader" \
-e "QUEUE_NAME=packingslip-print" \
-e "AWS_DEFAULT_REGION=eu-west-1" \
-e "AWS_ACCESS_KEY_ID=AK******CB" \
-e "AWS_SECRET_ACCESS_KEY=1P******a" \
aapjeisbaas/sqs-printer:latest
aws sqs send-message --queue-url https://sqs.eu-west-1.amazonaws.com/##########/packingslip-print --message-body '{"bucket": "awesome-bucketname", "key": "packingslips/116544516.pdf"}'
expected test output
Subscribing to sqs: https://eu-west-1.queue.amazonaws.com/##########/packingslip-print
2020-08-28 09:32:35.422806 Done sending pdf to printer: packingslips/116544516.pdf
| Key | Value | Explanation |
|---|---|---|
| DESTINATION | http://pdf-to-ipp.thuis/uploader | pdf-to-ipp http endpoint |
| QUEUE_NAME | packingslip-print | The name of your sqs queue |
| AWS_DEFAULT_REGION | eu-west-1 | The AWS reqion you want to connect to |
| AWS_ACCESS_KEY_ID | AK******CB | AWS cli credentials key |
| AWS_SECRET_ACCESS_KEY | 1P******a | AWS cli credentials secret |
This should be a json body that follows the format below, make sure you have no s3:// in the bucket and no leading / in the key.
{
"bucket": "awesome-bucketname",
"key": "packingslips/116544516.pdf"
}
The script subscribes to the queue and retrieves the messages.
For each message it downloads the file from S3 to /tmp/sqs-printer-pdf-tmp/ and sends the file to the pdf-to-ipp endpoint.
After this the temporary file gets deleted and starts polling for new messages.
Content type
Image
Digest
sha256:d0dba2789…
Size
53.6 MB
Last updated
4 months ago
docker pull aapjeisbaas/sqs-printer