lib/aerosol/instance.rb in aerosol-1.9.0 vs lib/aerosol/instance.rb in aerosol-1.9.1
- old
+ new
@@ -3,10 +3,11 @@
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
primary_key :instance_id
def live?
describe_again
instance_state_name == 'running'
@@ -54,9 +55,15 @@
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