I am struggling to actually invoke a function with AWS.lambda.invoke()
Can you perhaps provide a full example?
Using the example code, I have tried all permutations of the following:
Lambda setup
let lambda = new aws.Lambda({region: 'us-east-1', endpoint: 'http://localhost:3000/proxy' })
let lambda = new aws.Lambda({region: 'us-east-1', endpoint: 'http://localhost:3000' })
Invocation type
InvocationType: undefined
InvocationType: "Event"
InvocationType: "RequestResponse"
Payload
Payload: '{}'
Payload: '{ "name" : "Alex" }'
Lambda invoke
lambda.invoke({
FunctionName: 'hello',
InvocationType: invocationType,
Payload: payload
}, (err, data) => {/**/})
lambda.invoke({
FunctionName: 'serverless-offline-direct-lambda-example-dev-hello_proxy',
InvocationType: invocationType,
Payload: payload
}, (err, data) => {/**/})
lambda.invoke({
FunctionName: 'serverless-offline-direct-lambda-example-dev-hello',
InvocationType: invocationType,
Payload: payload
}, (err, data) => {/**/})
lambda.invoke({
FunctionName: '/proxy/serverless-offline-direct-lambda-example-dev-hello',
InvocationType: invocationType,
Payload: payload
}, (err, data) => {/**/})
lambda.invoke({
FunctionName: 'proxy/serverless-offline-direct-lambda-example-dev-hello',
Payload: '{}'
}, (err, data) => {/**/})
They all say Unsupported Media Type
What am I doing wrong?
I am struggling to actually invoke a function with
AWS.lambda.invoke()Can you perhaps provide a full example?
Using the example code, I have tried all permutations of the following:
Lambda setup
Invocation type
Payload
Lambda invoke
They all say
Unsupported Media TypeWhat am I doing wrong?