Queues and scheduled jobs are at Preview maturity. They haven’t been qualified on real AWS accounts.
Workers
A worker is a long-running process, such as a job runner, that runs next to the web service. Deployz runs one container for each worker your repository declares. Workers have no URL and receive no traffic. Deployz finds a worker in either of these places:- A
Procfile. Each process line becomes a worker, exceptweband processes that don’t run continuously, such asrelease,migration,build,test, ordev. - A production Compose file. A service whose name or command looks like a worker, such as a
workerservice that runs a job runner.
Procfile, push the change, and re-analyze.
Queues
Deployz can create Amazon SQS Standard queues (Preview) for messages that your processes send to each other. SQS FIFO queues aren’t supported.How Deployz finds a queue
Deployz creates a queue only when the evidence is clear. It reads JavaScript and TypeScript code only. All of these must be true:- Your application depends on an SQS library:
@aws-sdk/client-sqs,aws-sdk,sqs-consumer, orsqs-producer. - Your code reads the queue’s URL from an environment variable named
QUEUE_URL, or a name ending in_QUEUE_URLor_SQS_URL, such asORDERS_QUEUE_URL. - A process sends messages to the queue, and a process receives them. Deployz works out which process does what by following the imports from each process’s entry file.
- The process that receives messages is a worker or a scheduled job, not the web service.
boto3. To resolve it, make the producer and consumer clear in your code, or remove the queue code if you don’t use it, then re-analyze. Select Get fix instructions on the row for help. See Fix analysis findings.
How your processes connect
Deployz sets the queue’s URL under the variable name your code reads. If your code also reads an ARN variable for the queue, such asORDERS_QUEUE_ARN, Deployz sets that too. Only the processes that use the queue get these variables.
Each process gets only the permissions it needs, on that queue only:
A queue keeps messages for 4 days, with a visibility timeout of 30 seconds. Messages are encrypted with SQS-managed keys, and the queue refuses requests that don’t use HTTPS.
Dead-letter queue
If your code reads a dead-letter queue URL for a queue, in a variable such asORDERS_DLQ_URL or ORDERS_DEAD_LETTER_QUEUE_URL, Deployz creates a dead-letter queue for it. A message moves there after it’s received 5 times without being deleted. The dead-letter queue keeps messages for 14 days.
Scheduled jobs
A scheduled job (Preview) runs a command from your release on a schedule, as a one-off task that stops when the command finishes. Deployz runs it with Amazon EventBridge Scheduler.How Deployz finds a scheduled job
Deployz creates a scheduled job only from a production deployment file that names both a schedule and a command:render.yaml: a service withtype: cron, aschedule, and astartCommandordockerCommand.- A Kubernetes
CronJobmanifest: aschedule, and acommandorargs. ACronJobwithsuspend: trueis created turned off.
- A cron library that runs inside your application process. That work runs in the process itself.
- CI schedules, such as scheduled GitHub Actions workflows, and a cron string on its own.
vercel.jsoncronsandcrontabor.cronfiles. The analysis reports a Confirm a queue or schedule finding for these, because they don’t name a command Deployz can run.
Schedule format
A schedule is a standard cron expression with five fields: minute, hour, day of month, month, and day of week. The shortcuts@hourly, @daily, @weekly, @monthly, @yearly, and @annually also work.
The analysis reports a Confirm a queue or schedule finding instead of creating the job when the expression:
- Doesn’t have exactly five fields, for example because it includes seconds or a year.
- Uses
L,W,#, or?. - Restricts both the day of month and the day of week.
Time zone
A KubernetesCronJob can set timeZone to a time zone name, such as Europe/Berlin. If the name isn’t valid, the analysis reports a finding instead of creating the job. A job without a time zone, including every render.yaml job, runs in UTC.
Releases and rollbacks
A scheduled job always runs the release the deployment is on:- After you deploy an update, scheduled jobs switch to the new release only once the update has finished successfully. If the update fails, they stay on the previous release.
- When you roll back, scheduled jobs move to the release you roll back to. See Roll back a deployment.
