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
4,299,489
Community Members
 
Community Events
165
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 http://169.254.169.254/latest/meta-data/instance-id`
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***"
else
echo "Assign unused ip to instance"
aws ec2 associate-address --instance-id $instance_id --public-ip $EIP
echo $?
fi

 

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.

0 comments

Comment

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

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

966 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you