From 235abdf65eb80c95bc8ceab02660a324726c8838 Mon Sep 17 00:00:00 2001 From: Nathan LeClaire Date: Fri, 6 May 2016 18:03:07 -0700 Subject: [PATCH] Revise run instance script Signed-off-by: Nathan LeClaire --- alpine/aws/run-instance.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/alpine/aws/run-instance.sh b/alpine/aws/run-instance.sh index 5fa24d2cf..023c12301 100755 --- a/alpine/aws/run-instance.sh +++ b/alpine/aws/run-instance.sh @@ -21,6 +21,15 @@ INSTANCE_ID=$(aws ec2 run-instances --image-id ${AMI_ID} --instance-type t2.nano aws ec2 create-tags --resources ${INSTANCE_ID} --tags Key=Name,Value=moby-boot-from-ami +echo "Running instance ${INSTANCE_ID}" echo ${INSTANCE_ID} >./aws/instance_id.out -watch -n5 aws ec2 describe-instances --instance-ids ${INSTANCE_ID} +echo "Waiting for instance boot log to become available" + +INSTANCE_BOOT_LOG="null" +while [[ ${INSTANCE_BOOT_LOG} == "null" ]]; do + INSTANCE_BOOT_LOG=$(aws ec2 get-console-output --instance-id ${INSTANCE_ID} | jq -r .Output) + sleep 5 +done + +aws ec2 get-console-output --instance-id ${INSTANCE_ID} | jq -r .Output