Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
Pass event data to AWS Lambda through AWS CLI/Slack(ChatOps)

I have a very simple nodejs based AWS Lambda function which has an event variable that I am trying to pass through slack/AWS Cli while invoking the function on Mac OS. Below is the code

exports.handler = async (event) => {
const a = event["domain"];
    return a;
};

On testing function in AWS Lambda console if I provide set it up in below way it works fine.

enter image description here

It works fine and shows the result as expected. But when I am trying to run it using AWS Cli or Slack(ChatOps) it is not passing the event data. Below is the lambda invokation command I am using,

@aws lambda invoke --invocation-type RequestResponse --function-name manrill-test 
--region us-east-1 --payload "{ \"domain\": \"xyz.com\" }"

This shows the below message and looks like the payload/ event data is not being passed properly.

ExecutedVersion: $LATEST
StatusCode: 200
Payload:
null

Any idea what I am doing wrong? Ideally it should show the value of event data which I am passing (xyz.com).

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If you are using AWS CLI V2 then you need to add the "--cli-binary-format raw-in-base64-out" flag to pass raw json

aws lambda invoke --invocation-type RequestResponse --function-name manrill-test --region us-east-1 --payload "{ \"domain\": \"xyz.com\" }" --cli-binary-format raw-in-base64-out response.json
about 4 years ago · Juan Pablo Isaza Report

0

the issue is not on slack or lambda, its mac os keyboard setting. you have to uncheck "use smart quotation and dashes" keyboard settings under Text tab. check out the answer on the below link.

How to invoke aws lambda with payload from Slack

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!