Skip to content

Commit 9ba4556

Browse files
committed
fix: retry to assign the elastic ip
Signed-off-by: Lukas Hankeln <lukashankeln@googlemail.com>
1 parent 529fc68 commit 9ba4556

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

template/eip.tftpl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ export PATH=~/.local/bin:$PATH
77

88
pip install aws-ec2-assign-elastic-ip
99
export AWS_DEFAULT_REGION=$(curl -s -H "X-aws-ec2-metadata-token: $token" http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
10-
/usr/local/bin/aws-ec2-assign-elastic-ip --valid-ips ${eip}
10+
11+
for i in {1..7}
12+
do
13+
echo "Attempt: ---- " $i
14+
/usr/local/bin/aws-ec2-assign-elastic-ip --valid-ips ${eip} && break || sleep 60
15+
done

0 commit comments

Comments
 (0)