Class: Outliers::Resources::Aws::Ec2::Instance
Instance Attribute Summary
#source
Class Method Summary
collapse
Instance Method Summary
collapse
#id, #initialize, #method_missing, verifications
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Outliers::Resource
Class Method Details
.key ⇒ Object
6
7
8
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 6
def self.key
'instance_id'
end
|
Instance Method Details
#classic? ⇒ Boolean
10
11
12
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 10
def classic?
!vpc?
end
|
#running? ⇒ Boolean
14
15
16
17
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 14
def running?
logger.debug "Verifying '#{status}' equals 'running'."
status == :running
end
|
#source_dest_check? ⇒ Boolean
19
20
21
22
23
24
25
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 19
def source_dest_check?
unless vpc?
logger.debug "Instance must be in a VPC to validate source_dest_check. Returning false."
return false
end
source_dest_check == true
end
|
#valid_image_id?(args) ⇒ Boolean
27
28
29
30
31
32
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 27
def valid_image_id?(args)
image_ids = Array(args[:image_ids])
logger.debug "Verifying Image ID '#{image_id}' is one of '#{image_ids.join(', ')}'."
image_ids.include? image_id
end
|
#vpc? ⇒ Boolean
34
35
36
|
# File 'lib/outliers/resources/aws/ec2/instance.rb', line 34
def vpc?
!source.vpc_id.nil?
end
|