Welcome!
That's not the exact code, right? You edited it I think.
What are the properties?
BTW did you look at Cloud by Elastic, also available if needed from AWS Marketplace ?
Cloud by elastic is one way to have access to all features, all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named Observability, Security, Enterprise Search and what is coming next
...
In case it helps, here's a sample project which uses the HLClient.
And also