lib/cloudster/ec2.rb in cloudster-2.4.0 vs lib/cloudster/ec2.rb in cloudster-2.5.0

- old
+ new

@@ -1,9 +1,10 @@ module Cloudster #==Ec2 resource class Ec2 + attr_accessor :template, :name # Initialize an Ec2 instance # # ==== Notes # options parameter must include values for :name, :key_name and :image_id # @@ -41,10 +42,10 @@ # ec2.template # # ==== Returns # * Ruby hash version of the Cloud Formation template for the resource instance def template - Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type}) + @template ||= Ec2.template({:name =>@name, :key_name => @key_name, :image_id => @image_id, :instance_type => @instance_type}) end # Class method that returns a Ruby hash version of the Cloud Formation template # # ==== Examples