Elastic Agent Instance startup script samples
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Bamboo elastic agents allow you to configure an instance start-up script at Bamboo Administration > Overview > Image Configurations > Edit. This script is executed when the EC2 instance starts. Below are some sample instance-startup scripts to achieve different things which you may find useful as a reference point.
Bamboo Global variables are not accessible from the instance startup script text field. Variables are only available to the Elastic agent after it is online.
If you have a specific need for a Global variable in an elastic agent, you can use plan variables along with a script task in a Job.
Solution
Adding JAVA options
Appending the path variable
Changing MAVEN_HOME definition