I am using CreateJobCommandInput
, CreateJobCommand
, MediaConvertClient
from @aws-sdk/client-mediaconvert
to submit MediaConvert job. CreateJobCommandInput
contains a lot of different parameters. I would like to check if those parameters are valid using some sort of unit tests. Is this possible?

- 1,954
- 20
- 28
1 Answers
Thanks for your message. AWS MediaConvert validates job settings upon submittal. Unit testing (individual feature testing) is not supported today.
However, you can save a collection of validated output settings as an output preset which can be re-used and stacked (combined) on future jobs. You can test, validate and accumulate collections of output settings in this way.
Additional tips: [a] when testing settings, you can use the 'input clipping' function to convert just 30s of content for a quicker result on your tests.
[b] All 'create job' calls will have an API log record which you can retrieve via AWS CloudTrail. Jobs which execute will also get a log entry in AWS CloudWatch.
[c] Fronting your S3 destination bucket with a CloudFront distribution will allow you to stream/access your outputs without making the S3 bucket itself public-readable. You can optionally restrict access to the CF distribution in various ways using AWS Web Application Firewall.
You can see the full specification for all available parameters using a command of the form 'aws mediaconvert create-job --generate-cli-skeleton'

- 324
- 2
- 5
-
I can find create job events, but there aren't any completion or progression events? – xtrinch May 18 '23 at 09:28
-
That is correct. Job progression and completion are tracked as metadata but they do not emit API events. The status for both can be gotten in response to either a 'get_job' call (for a specific job) or a list_jobs call (shows status of all jobs). You can try these from the ACW CLI or CloudShell prompt. FYI the AWS Console makes a List_jobs call in the background every ~10s or so to update the web display. Additionally there will be a CloudWatch log message (not an API event) with the job completion message or an error message. – aws-robclem May 19 '23 at 17:22
-
You can query CloudWatch logs with a separate API call, and if you wish, you can have CloudWatch log messages forwarded by a Lambda function to a REST endpoint (such as Slack) or to an SNS topic. – aws-robclem May 19 '23 at 17:22
-
I cannot find any logs (nor are there any log groups for mediaconvert) in CloudWatch in AWS console, I was however able to create a `aws_cloudwatch_event_rule` & `aws_cloudwatch_event_target` via terraform to send completion event to SQS and somehow it magically works... – xtrinch May 21 '23 at 17:24
-
The default log groups is at /aws/events/ElementalMediaConvert. You can verify this from your AWS CLI or cloudShell prompt by running `aws logs describe-log-groups |grep Convert` . You can also check logs from the CLI ; try command: ```L5M=` expr $DS - 300 `; aws logs filter-log-events --log-group-name "/aws/events/ElementalMediaConvert" --start-time $L5M --max-items 50 --filter-pattern "" |grep -i -o -E 'jobId.{60}' ``` – aws-robclem May 24 '23 at 15:41