5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/hashicorptools/update_launch_configuration.rb', line 5
def deploy(asg_name)
asg = AutoScalingGroup.new(name: asg_name, region: options[:aws_region])
if asg.group.nil?
raise "could not find asg #{asg_name}"
end
current_count = asg.group.instances.size || 1
if asg.group.max_size < (current_count * 2)
raise "max size must be more than twice current count to deploy a new AMI"
else
asg.set_desired_instances(current_count * 2)
asg.set_desired_instances(current_count)
asg.verify_all_instances_using_correct_ami
end
end
|