Module: AwsWatcher::EC2
- Defined in:
- lib/aws-watcher.rb
Class Method Summary collapse
Class Method Details
.client(config) ⇒ Object
22 23 24 |
# File 'lib/aws-watcher.rb', line 22 def self.client(config) Aws::EC2::Client.new(config[:aws]) end |
.instance_alive?(id, config) ⇒ Boolean
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/aws-watcher.rb', line 26 def self.instance_alive?(id, config) AwsWatcher::EC2.client(config).describe_instance_attribute( attribute: 'instanceType', instance_id: id.to_s ) true rescue Aws::EC2::Errors::InvalidInstanceIDNotFound => e p "instance: #{id} was not found." if ENV['LOG_LEVEL'] == 'DEBUG' p e end false end |