as of now elastic beanstalk allows to upload a single jar file for deployment.
i want to run custom script as per the below command for starting the application.
sudo java -Dlogging.file=/home/ec2-user/server.log -Xmx8192m -javaagent:/home/ec2-user/server/elastic-apm-agent-1.12.0.jar
-Delastic.apm.service_name=service-name
-Delastic.apm.application_packages=com.demo
-Delastic.apm.server_urls=xxx
-Delastic.apm.secret_token=XXX
-jar $server_name-0.0.1-SNAPSHOT.jar
--spring.profiles.active=prod
not sure if we can do it with some config file to specify the path of the java agent if we know the path of the java agent jar
In EB configuration > environment properties, you'd have to set JAVA_TOOL_OPTIONS=-javaagent:/home/ec2-user/server/elastic-apm-agent-1.12.0.jar
and the rest of your -D and -Xmx properties in _JAVA_OPTIONS
.
You will also need to download the agent using ebextensions config:
files:
"/home/ec2-user/server/elastic-apm-agent-1.12.0.jar":
mode: "000444"
owner: root
group: root
source: "https://<host>/elastic-apm-agent-1.12.0.jar"