Skip to content

Commit f6dea47

Browse files
authored
fix: add Name tag AFTER shutdown set, reap instances with no name within 5m (#20407)
as title
2 parents 7e20c48 + 154f281 commit f6dea47

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ci3/aws_request_instance_type

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ if [ -z "${iid:-}" -o "${iid:-}" == "None" ]; then
8686
echo $iid > $iid_path
8787
fi
8888

89-
aws ec2 create-tags --resources $iid --tags "Key=Name,Value=$name"
90-
aws ec2 create-tags --resources $iid --tags "Key=Group,Value=build-instance"
91-
if [ "${UNSAFE_AWS_KEEP_ALIVE:-0}" -eq 1 ]; then
92-
echo_stderr "You have set UNSAFE_AWS_KEEP_ALIVE=1, so the instance will not be terminated after 1.5 hours by the reaper script. Make sure you shut the machine down when done."
93-
# Tag instance with Keep-Alive=true
94-
aws ec2 create-tags --resources $iid --tags "Key=Keep-Alive,Value=true"
95-
fi
96-
9789
while [ -z "${ip:-}" ]; do
9890
sleep 1
9991
ip=$(aws ec2 describe-instances \
@@ -115,3 +107,6 @@ while ! ssh -F $SSH_CONFIG_PATH -o ConnectTimeout=1 $ip $LIVE_CMD > /dev/null 2>
115107
fi
116108
sleep 1
117109
done
110+
111+
aws ec2 create-tags --resources $iid --tags "Key=Name,Value=$name"
112+
aws ec2 create-tags --resources $iid --tags "Key=Group,Value=build-instance"

0 commit comments

Comments
 (0)