Trouble setting up NodeJS grpc in AWS EC2

104 views Asked by At

I am fairly new to AWS and I'm trying to run a grpc server on my AWS EC2 instance but I'm unable to run the bindAsync function. Here is my bindAsync function:

server.bindAsync('0.0.0.0:80', grpc.ServerCredentials.createInsecure(), () => {
        server.start();
});

And I get the error

E No address added out of total 1 resolved
/home/ec2-user/server/node_modules/@grpc/grpc-js/build/src/server.js:543
            throw new Error('server must be bound in order to start');
            ^

Error: server must be bound in order to start
    at Server.start (/home/ec2-user/server/node_modules/@grpc/grpc-js/build/src/server.js:543:19)
    at /home/ec2-user/server/server.js:23:9
    at /home/ec2-user/server/node_modules/@grpc/grpc-js/build/src/server.js:267:36
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Here are few things I thought it was but I'm still unsure

  1. In AWS I have to change the security group for my EC2 instance but it looks like port 80 is open for all users for the HTTP protocol
  2. There is something called TLS and I've never had to create that for my grpc server but maybe for AWS I have to

Let me know if I should add any more details! Thank you!

0

There are 0 answers