0

I am just attempting to call describeEndpoints of mediaconvert SDK but seems like it times out, why could that be. I already gave my Lambda function admin access. I set timeout to 30s which should be more than sufficient but it still fails

const AWS = require('aws-sdk');
const util = require('util');

async function test() {
    let mediaconvert = new AWS.MediaConvert();
    const describeEndpoints = util
        .promisify(mediaconvert.describeEndpoints)
        .bind(mediaconvert);
    return await describeEndpoints()
}
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
  • All AWS JavaScript SDK methods have a promise equivalent, for example: let rc = await mediaconvert.describeEndpoints().promise(). – jarmod Aug 12 '19 at 14:34
  • Have you launched lambda in vpc ? if so, check if it has nat gateway , lambda doesn't work with subnet with route igw. – James Dean Aug 12 '19 at 14:34
  • @JamesDean I think you are right, let me check – Jiew Meng Aug 13 '19 at 07:06
  • @jarmod good point – Jiew Meng Aug 13 '19 at 07:06
  • @JamesDean just added NAT to my route table and allowed all traffic for security group in and out. Same for NACL. It seems like it can describeEndpoints but cannot getJob... what could possibily be wrong? Its not a permissions error it seems cos it has the IAM permission and its a timeout and not 403 – Jiew Meng Aug 13 '19 at 09:37
  • @JamesDean you can actually make it an answer, its timing out not because of mediaconvert calls but because my DB security group was incorrect. So the main thing I needed was the NAT gateway and HTTPS out – Jiew Meng Aug 13 '19 at 10:01

2 Answers2

0

Have you launched lambda in vpc ? if so, check if it has nat gateway , lambda doesn't work with subnet with route igw.

James Dean
  • 4,033
  • 1
  • 9
  • 18
0

Use this instead of describing then:

const mediaConvert = new AWS.MediaConvert(
{ endpoint: 'MEDIACONVERT REGIONAL API ENDPOINT', });
rounak tadvi
  • 21
  • 1
  • 5