Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

how to assign Elastic IP'S parallel when we launch instances from AMI using start up script.

Hi Team,

How to assign Elastic IP'S parallel when we launch instances from AMI using start up script from bamboo.

Could you please suggest on it.

FYI : able to assign elastic ip's sequentially from start up script.

startup script:
echo "sleep for some time,Amazon enough time to associate the Elastic IP without interrupting any of the Bamboo processes"
sleep 90
echo "assign elastic Ip to ElasticAgent instance"
export AWS_ACCESS_KEY_ID="*****************
export AWS_SECRET_ACCESS_KEY=*****************
export AWS_DEFAULT_REGION=*******************
export instance_id=`/usr/bin/curl -s`
echo $instance_id
aws ec2 describe-addresses --query 'Addresses[?AssociationId==null]' > output.json
cat output.json
EIP=$(cat output.json | jq -r '.[0] | .PublicIp')

echo "EIP:$EIP"

if [ "$EIP" = "NULL" ]; then
echo "***Nothing to be assign to instance***"
echo "Assign unused ip to instance"
aws ec2 associate-address --instance-id $instance_id --public-ip $EIP
echo $?


Note: I want 10 to 15 seconds instance launching delay to assign elastic IP'S.

   could you please suggest on how to customize above mentioned script or how to delay  instance launches from bamboo startup script or any configurations need to be change from AWS side.



Log in or Sign up to comment
Community showcase
Published in Bamboo

Bamboo - introducing LTS releases

We know that many of you have been asking for Long Term Support versions for Bamboo, as managing large, complex instances can require plenty of lead time and planning to prepare for an upgrade. To ...

300 views 0 8
Read article

Atlassian Community Events