From 14a83181d21d241331a211665193cab640289c5d Mon Sep 17 00:00:00 2001 From: Noah Gibbs Date: Wed, 4 Mar 2020 14:00:19 +0000 Subject: [PATCH] Update launch script for non-AppFolio changes --- scripts/launch_instance.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/launch_instance.rb b/scripts/launch_instance.rb index ba2deee..7b24332 100755 --- a/scripts/launch_instance.rb +++ b/scripts/launch_instance.rb @@ -5,10 +5,11 @@ # While you might get some useful ideas here, this script is *not* general-purpose # and will *not* do exactly what you wish it would. It's pretty specific to my workflow. -latest_ami = 'ami-052d56f9c0e718334' +latest_ami = 'ami-0bca9c583e83ac8e8' # This is in us-west-2 inst_name = ENV['INSTANCE_NAME'] || 'RailsRubyBenchTestInstance' inst_type = ENV['INSTANCE_TYPE'] || 'm4.2xlarge' -json_out = `aws ec2 run-instances --count 1 --instance-type #{inst_type} --key-name noah-packer-1 --placement Tenancy=dedicated --image-id #{latest_ami} --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=#{inst_name}}]'` +placement = ENV['PLACEMENT'] ? "--placement #{ENV['PLACEMENT']}" : "" # --placement Tenancy=dedicated +json_out = `aws ec2 run-instances --count 1 --instance-type #{inst_type} --key-name noah-packer-1 #{placement} --image-id #{latest_ami} --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=#{inst_name}}]'` ec2_info = JSON.parse(json_out) @@ -25,9 +26,8 @@ scp -i ~/.ssh/noah-packer-1.pem ubuntu@#{inst_ip}:~/rails_ruby_bench/data/*.json . scp -i ~/.ssh/noah-packer-1.pem ubuntu@#{inst_ip}:~/rsb/data/*.json . aws ec2 terminate-instances --instance-ids #{id} - -AppFolio only: assume-role appfolio-dev User MFA_TOKEN LINES puts cmd_lines File.open("#{ENV["HOME"]}/rrb_commands.txt", "w") { |f| f.puts(cmd_lines) } end +