Can we add a network load balancer on top of Aws OpenSearch Service. Our requirement is to run logstash in ECS and route the traffic to these from specific ports via NLB. But I didn’t found good sources to implement it.

Can we add a network load balancer on top of Aws OpenSearch Service. Our requirement is to run logstash in ECS and route the traffic to these from specific ports via NLB. But I didn’t found good sources to implement it.

What would be the target group of that NLB ?

IPs of LB thats behind OpenSearch generated managed url ?

Those IPs can change over time and you have no control over that.

Better thing to do is to expose OpenSearch via custom domain and configure logstash as a daemonset which forwards to OS.

Example on ECS can be any daemonset deployment tbh.

Yes we can forward to OpenSearch from logstash. But the thing is we want to have a nlb on both logstash in ECS and managed OpenSearch so we will alias the nlb generated host name in Route 53 record. So want to add this record where the logs are writing from 2 ports. And we want to use the same route 53 url to access the kibana dashboard from port 443.

So 2 ports should hit the logstash in ECS where the logs are writing from and port 443 should hit kibana dashboard(OpenSearch)

Logstash will send the logs to OpenSearch without nlb anyways.

Register logstash in one target group. Create your own proxy for sending to OS. Configure logstash to write to proxy.

Configure nginx to expose everything on different ports.

But I see absolutely no reason to do it this way.

The problem is not logstash writing to OS it can write with or without nlb/proxy. The only reason for nlb is it should direct the traffic to logstash and OS based on the incoming ports.

Issue is NLB cannot do that. Car no go space, car no fly.

And it makes no sense to put NLB between containers in ECS. Thats what host bridge network is for.

So we cannot host nlb on top of OpenSearch?

No because you have no way to define target group for OS..

So do you suggest adding a proxy on top on OS and add that proxy in target group