Skip to content

Output to S3


As of version 7.4.0, PLOSSYS Output Engine can upload the spool file of a print job to an S3-compatible object store instead of, or in addition to, printing it. This is typically used for digital archiving or for handing jobs over to a downstream process (e.g. a customer-side Lambda function) instead of a physical printer.

The S3 output is implemented as part of the seal-checkout service.

Hint - authentication method

Only static credentials (accessKeyId and secretAccessKey) are supported for accessing the bucket. Role-based access (e.g. AWS IAM roles, assumeRole) is not yet implemented.

Hint - process printing (DPF)

This use case covers S3 output for PLOSSYS Output Engine print jobs. For process printing via DPF, S3 output is implemented separately as the seal-dpfwu-s3-copy-from-rli working unit.


Configuration

For each printer that should output to S3, the connection printer key has to be specified as

connection: 's3://'

The bucket, credentials and other S3-specific settings are configured either system-wide with service keys, or per printer with the s3 section of the printer configuration, which takes precedence.

Example - printer connection with s3

- printer: printers3
  connection: 's3://'
  server: spooler1
  s3:
    bucket: mybucket
    accessKeyId: blablaaccess
    secretAccessKey: blablasecret
    region: eu-central-1
    endpoint: https://s3.eu-central-1.amazonaws.com
    fileNameTemplate: '{{job.current.userName}}/{{job._id}}.pdf'
    metadataKeys: 'jobName,userName'

File Naming and Metadata

The fileNameTemplate key specifies the S3 object key (file name) for the uploaded spool file. It is a template string with placeholders for job parameters enclosed in double curly brackets, e.g. {{job.current.jobName}}-{{job.current.userName}}.pdf.

Hint - folder structure

The object key may contain /, which creates a folder-like structure in the bucket, e.g. {{job.current.userName}}/{{job._id}}.pdf uploads the file into a "folder" named after the user.

The job parameters are also uploaded as S3 object metadata. Since S3 limits metadata to 2 KB per object, PLOSSYS Output Engine uploads all job parameters as metadata as long as this limit is not exceeded; if it is, only the parameters listed in metadataKeys are uploaded, reducing this list further if still necessary.


Service Keys

The following service keys are available for the seal-checkout service. S3_BUCKET, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY are mandatory, either as a service key or as the corresponding printer key; the others are optional.

  • S3_BUCKET: Mandatory. The bucket to upload the spool file to.

  • S3_ACCESS_KEY_ID: Mandatory. The access key ID for accessing the bucket.

  • S3_SECRET_ACCESS_KEY: Mandatory. The secret access key for accessing the bucket.

  • S3_REGION: Optional. The S3 region, default is eu-central-1.

  • S3_ENDPOINT: Optional. The endpoint, only required for S3-compatible storage other than AWS; default is to evaluate the endpoint automatically.

  • S3_FILE_NAME_TEMPLATE: Optional. The template for the uploaded object's file name, default is {{job._id}}.prn.

  • S3_METADATA_KEYS: Optional. The job parameters used as a fallback if the full metadata exceeds the 2 KB limit, default is jobName,userName,outputFormat.

Each of the service keys can be overwritten for a specific printer with the corresponding s3 section printer key.

Example - setting the S3 service keys via PLOSSYS CLI

plossys config set S3_BUCKET mybucket --service checkout
plossys config set S3_ACCESS_KEY_ID blablaaccess --service checkout
plossys config set S3_SECRET_ACCESS_KEY blablasecret --service checkout
plossys config set S3_REGION eu-central-1 --service checkout
plossys config set S3_ENDPOINT https://s3.eu-central-1.amazonaws.com --service checkout

Example - setting the S3 service keys via configuration file

service:
  checkout:
    tag:
      any:
        S3_BUCKET: mybucket
        S3_ACCESS_KEY_ID: blablaaccess
        S3_SECRET_ACCESS_KEY: blablasecret
        S3_ENDPOINT: https://s3.eu-central-1.amazonaws.com

Printer-Specific Keys

The following printer-specific keys are available in the s3 section for printers using the s3 connection. bucket, accessKeyId and secretAccessKey are mandatory, either here or as the corresponding service key; the others are optional.


Back to top