Class: Leeroy::Types::Instance
- Includes:
- Helpers::Dumpable, Helpers::Logging
- Defined in:
- lib/leeroy/types/instance.rb
Constant Summary
Constants included from Helpers::Logging
Helpers::Logging::TRACE_FORMAT, Helpers::Logging::TRACE_LEVELS, Helpers::Logging::TRUNCATE_THRESHOLD
Instance Attribute Summary
Attributes included from Helpers::Dumpable
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ Instance
constructor
A new instance of Instance.
- #run_params ⇒ Object
Methods included from Helpers::Logging
Methods included from Helpers::Dumpable
Methods inherited from Dash
Constructor Details
#initialize(*args, &block) ⇒ Instance
Returns a new instance of Instance.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/leeroy/types/instance.rb', line 30 def initialize(*args, &block) self.aws_params = [ :iam_instance_profile, :image_id, :instance_type, :key_name, :max_count, :min_count, :security_group_ids, :subnet_id, :user_data, ] self.dump_properties = self.aws_params super end |
Instance Method Details
#run_params ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/leeroy/types/instance.rb', line 48 def run_params begin params_hash = Leeroy::Types::Mash.new self.aws_params.each {|param| params_hash.store(param.to_s, self.fetch(param.to_s))} # UserData is special! params_hash.store('user_data', self.fetch('user_data').encoded_for_ec2) params_hash rescue StandardError => e raise e end end |