I was to deploy multiple microservices to AWS ECS.
The communication protocol is gRPC
.
On local env those containers are working because they are in the same network.
My questions are:
For example:
async function bootstrap() {
const microserviceOptions = {
transport: Transport.GRPC,
options: {
url: '0.0.0.0:50050',
package: 'user',
protoPath: path.join(
__dirname,
'../node_modules/@george-hutanu/slick-shared-packages/src/gRPC/proto-schemas/user.proto',
),
},
};
const app = await NestFactory.createMicroservice(
HasuraModule,
microserviceOptions,
);
await app.listen();
}
(() => bootstrap())();
This is one of my gRPC clients:
export const gRPCUserClientConfig: ClientOptions = {
transport: Transport.GRPC,
options: {
url: '0.0.0.0:50050',
package: 'user',
protoPath: path.join(
__dirname,
'../../../../node_modules/@george-hutanu/slick-shared-packages/src/gRPC/proto-schemas/user.proto',
),
},
}
Those microservices being in separate containers will they know about that '0.0.0.0:50050' network?
It seems you're looking for service-to-service connectivity in AWS ECS and if you deploy your current setup, it won't work.
Actually, you got 4 options to do this in AWS ECS.