Is it possible to deploy a NestJS (non-http) micro-service on AWS lambda?

Viewed 30

I've written a microservice using NestJS. (Actually two microservices they using the Same Module in one APP structure.) The North-Bound of microservice is using GRPC and the east-west using RabbitMQ.

North Bound:

  const northBound = await NestFactory.createMicroservice<MicroserviceOptions>(
    MyModule,
    {
      transport: Transport.GRPC,
      options: {
        package: 'mypackage',
        protoPath: join(__dirname, 'domain/myservice.proto'),
        url: `0.0.0.0:${MY_GRPC_PORT}`,
        loader: { keepCase: true, defaults: true },
      },
      logger: northBoundLogger,
    },
  );

East-West:

  const eastwest = await NestFactory.createMicroservice<MicroserviceOptions>(
    MyModule,
    {
      transport: Transport.RMQ,
      options: {
        urls: [`amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}`],
        queue: RABBITMQ_MY_QUEUE,
        queueOptions: {
          durable: true,
        },
        noAck: true,
      },
      logger: eastwestLogger,
    },
  );

I can't find out any example on the web which has deployed a non-HTTP nestjs micro-service using serverless framework on AWS lambda.

Is this possible?

0 Answers
Related