Class: Ec2::Blackout::Startup

Inherits:
Object
  • Object
show all
Defined in:
lib/ec2-blackout/startup.rb

Instance Method Summary collapse

Constructor Details

#initialize(ui, options) ⇒ Startup

Returns a new instance of Startup



5
6
7
# File 'lib/ec2-blackout/startup.rb', line 5

def initialize(ui, options)
  @ui, @options = ui, options
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/ec2-blackout/startup.rb', line 9

def execute
  @ui.say 'Dry run specified - no instances will be started'.bold if @options.dry_run
  @ui.say "Starting instances"
  @options.regions.each do |region|
    @ui.say "Checking region #{region}"
    startup(Ec2::Blackout::AutoScalingGroup.groups(region, @options))
    startup(Ec2::Blackout::Ec2Instance.stopped_instances(region, @options))
  end
  @ui.say 'Done!'
end