Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

314
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda