summaryrefslogtreecommitdiff
path: root/buildscripts/launch_evergreen_ec2_instance.sh
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-01-02 21:40:05 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2018-01-02 21:41:05 -0500
commite4ba7722773f68d42a66af7439e585cc2136d003 (patch)
treeb96ca686caed40a21d8d4a6ec4a7e8399a454135 /buildscripts/launch_evergreen_ec2_instance.sh
parent276bc00ce7a5086a4524cf8d57c68a3ac5f32c8c (diff)
downloadmongo-e4ba7722773f68d42a66af7439e585cc2136d003.tar.gz
SERVER-32403 Increase remote EC2 expire time to 3 hours
Diffstat (limited to 'buildscripts/launch_evergreen_ec2_instance.sh')
-rwxr-xr-xbuildscripts/launch_evergreen_ec2_instance.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/buildscripts/launch_evergreen_ec2_instance.sh b/buildscripts/launch_evergreen_ec2_instance.sh
index 7562e5ab79a..58692a0c5ff 100755
--- a/buildscripts/launch_evergreen_ec2_instance.sh
+++ b/buildscripts/launch_evergreen_ec2_instance.sh
@@ -17,6 +17,7 @@ This script supports the following parameters for Windows & Linux platforms:
-y <aws_ec2_yml>, [REQUIRED] YAML file name where to store the new AWS EC2 instance
information. This file will be used in etc/evergreen.yml for
macro expansion of variables used in other functions.
+ -e <expire_hours>, [OPTIONAL] Number of hours to expire the AWS EC2 instance.
-s <security_group>, [OPTIONAL] The security group to be used for the new AWS EC2 instance.
To specify more than one group, invoke this option each time.
-t <tag_name>, [OPTIONAL] The tag name of the new AWS EC2 instance.
@@ -24,9 +25,12 @@ EOF
}
# Parse command line options
-while getopts "k:s:t:y:?" option
+while getopts "e:k:s:t:y:?" option
do
case $option in
+ e)
+ expire_hours=$OPTARG
+ ;;
k)
ssh_key_id=$OPTARG
;;
@@ -61,6 +65,10 @@ do
security_groups="$security_groups --securityGroup $sec_group"
done
+if [ ! -z $expire_hours ]; then
+ expire_tag="--tagExpireHours $expire_hours"
+fi
+
# Get the AMI information on the current host so we can launch a similar EC2 instance.
# See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html#instancedata-data-retrieval
aws_metadata_url="http://169.254.169.254/latest/meta-data"
@@ -146,6 +154,7 @@ aws_ec2=$(python buildscripts/aws_ec2.py \
$security_groups \
--tagName "$tag_name" \
--tagOwner "$USER" \
+ $expire_tag \
$block_device_option | tr -cd "[:print:]\n")
echo "Spawned new AMI EC2 instance: $aws_ec2"