It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

1,417 views 2 7
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