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

439
Views
Nodo AWS SDK v3: ¿Tipos para argumentos `evento` y `contexto` en funciones Lambda?

Voy a cambiar al nuevo SDK de Node AWS (v3) para aprovechar su modularidad y compatibilidad con TypeScript. Lo primero que tenía que hacer era escribir una función Lambda, pero no puedo encontrar tipos que admitan la firma de la función del controlador. Los tipos en @aws/client-lambda parecen estar todos relacionados con, bueno, un cliente para administrar Lambda.

¿El SDK de Node tiene tipos oficiales para escribir Lambdas en alguna parte? En particular:

  • ¿Dónde está el tipo para el argumento de context ?
  • Para el argumento de event , ¿hay una lista en alguna parte de los eventos que pueden provenir de otros servicios de AWS y sus tipos correspondientes?
 interface Event { // This could be anything -- a custom structure or something // created by another AWS service, so it makes sense that // there isn't a discoverable type for this. There should be // corresponding types for each service that can send events // to Lambda functions though. Where are these? } interface Context { // This is provided by Lambda, but I can't find types for it anywhere. // Since it's always the same, there should be a type defined somewhere, // but where? } exports.handler = ( event: Event, context: Context )=>{ // While `event` could anything so it makes sense to not have a single type available, // `context` is always the same thing and should have a type somewhere. }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use tipos aws-lambda , tiene tipos para la mayoría de los eventos.

Controladores de ejemplo:

 import { SQSHandler, SNSHandler, APIGatewayProxyHandler } from 'aws-lambda'; export const sqsHandler: SQSHandler = async (event, context) => { } export const snsHandler: SNSHandler = async (event, context) => { } export const apiV2Handler: APIGatewayProxyHandler = async (event, context) => { return { body: 'Response body', statusCode: 200 } }
over 4 years ago · Santiago Trujillo 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!