-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basically working through download link
- Loading branch information
Showing
15 changed files
with
3,502 additions
and
1,979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nodejs 16.14.0 | ||
java corretto-19.0.1.10.1 | ||
aws-sam-cli 1.97.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const { CreateJobCommand, MediaConvertClient } = require("@aws-sdk/client-mediaconvert"); | ||
|
||
|
||
module.exports.handler = async (event) => { | ||
|
||
console.log("MEDIA CONVERT LAMBDA") | ||
console.log(event) | ||
|
||
const jobQueueArn = process.env.MEDIA_CONVERT_JOB_QUEUE_ARN; | ||
const iamRoleArn = process.env.MEDIA_CONVERT_ROLE_ARN; | ||
|
||
const params = { | ||
"Queue": jobQueueArn, | ||
"UserMetadata": {}, | ||
"Role": iamRoleArn, | ||
"Settings": event.settings, | ||
"AccelerationSettings": { | ||
"Mode": "DISABLED" | ||
}, | ||
"StatusUpdateInterval": "SECONDS_60", | ||
"Priority": 0 | ||
} | ||
|
||
const job = await createJob(params); | ||
|
||
return {jobId: job.Job.Id, status: job.Job.Status} | ||
}; | ||
|
||
async function createJob(params){ | ||
const mediaConvertClient = new MediaConvertClient({endpoint: process.env.MEDIA_CONVERT_ENDPOINT}); | ||
|
||
try { | ||
const data = await mediaConvertClient.send(new CreateJobCommand(params)); | ||
console.log("Success! ", data); | ||
return data | ||
} catch (err) { | ||
console.log("Error", err); | ||
return null; | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.