Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

307
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda