lib/aerosol/instance.rb in aerosol-1.9.1 vs lib/aerosol/instance.rb in aerosol-1.9.2
- old
+ new
@@ -3,11 +3,15 @@
class Aerosol::Instance
include Aerosol::AWSModel
aws_attribute :availability_zone, :health_status, :instance_id, :lifecycle_state
aws_class_attribute :launch_configuration, Aerosol::LaunchConfiguration
- aws_class_attribute :launch_template, Aerosol::LaunchTemplate
+ aws_class_attribute(
+ :launch_template,
+ Aerosol::LaunchTemplate,
+ proc { |argument| argument.fetch(:launch_template, {})[:launch_template_name] }
+ )
primary_key :instance_id
def live?
describe_again
instance_state_name == 'running'
@@ -55,15 +59,9 @@
instances.concat(new_instances.auto_scaling_instances)
next_token = new_instances.next_token
end until next_token.nil?
instances
- end
-
- def self.from_hash(hash)
- instance = super(hash)
- instance['launch_template'] = (hash[:launch_template][:launch_template_name]) if hash[:launch_template]
- instance
end
private
def describe!
ensure_present! :instance_id