Skip to content

Laravel site with ElasticSearch on AWS

This maybe more of an AWS or networking question, but I was hoping to get advice from someone who has actually deployed a Laravel site with ElasticSearch on AWS.I was able to set up my Laravel application in Elastic Beanstalk and route my domain to the application. I was able to set up a cluster of three EC2 instances for ElasticSearch, but I’m struggling to figure out how to connect Beanstalk to these instances and/or whether this configuration is the wrong approach (ie: should ElasticSearch be in Elastic Beanstalk instead?).I am using the ElasticSearch-PHP library which allows me to set multiple IP addresses as the hosts, but should I use the private EC2 IP addresses (that didn’t seem to work)? Do I need to configure the EC2 instances a certain way so that Elastic Beanstalk can query on them?I used the ElasticSearch documentation for AWS: https://www.elastic.co/blog/running-elasticsearch-on-aws and the AWS documentation for Laravel applications: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.htmlI’ve been through a lot of other docs and tuts too, but I can’t seem to find the right info.