2

I am trying to create job of mediaconverter aws service through lambda but I m getting error

"Error BadRequestException: You must use the customer-specific endpoint"

AWS.config.update({region: 'us-east-1'});
    var mediaconvert = new AWS.MediaConvert("https://xyzyzyzzz.mediaconvert.us-east-1.amazonaws.com");
    console.log("End Point Set");
    await mediaconvert.createJob(params, function(err, data) {
    console.log('started execution');
    if (err){ console.log(err, err.stack); 
        console.log("non promise error");     
        callback(null, {
            statusCode: 200, 
            body: JSON.stringify(data)
        });
    } // an error occurred
    else   {  console.log("non promise no error");       
        callback(null, {
            statusCode: 200, 
            body: JSON.stringify(data)
        });
    }
        // successful response
  });
Robert Kossendey
  • 6,733
  • 2
  • 12
  • 42

3 Answers3

1

the easiest way to find you mediaconvert endpoint is to go to mediaconvert service -> from left panel select account and there's your endpoint.

I found mine https://xxxxx.mediaconvert.ap-south-1.amazonaws.com

Hope this helps.

ashraf minhaj
  • 504
  • 2
  • 14
0

That is the error you get when the endpoint is not specified or if it's an invalid value. The constructor for MediaConvert accepts an object, not just a string, as outlined in the docs. You need to pass the endpoint URI in an object like so:

var mediaconvert = new AWS.MediaConvert({
  endpoint: "https://xyzyzyzzz.mediaconvert.us-east-1.amazonaws.com"
});

For context, the endpoint can be found in the console in the MediaConvert service under the Account section or it can be fetched through the API as outlined here. In general, this value should be cached as it has a much lower request rate limit than the other MediaConvert endpoints. There is one endpoint per account per region.

Semimono
  • 664
  • 1
  • 6
  • 14
-1

You did not specify the params in your createJob call.

The documentation tells you what you need in order to create a job.

Robert Kossendey
  • 6,733
  • 2
  • 12
  • 42