def template(options = {})
      require_options(options, [:resources])
      resources = options[:resources]
      description = options[:description] || 'This stack is created by Cloudster'
      resource_template = {}
      output_template = {}
      resources.each do |resource|
        resource_template.merge!(resource.template['Resources'])
        output_template.merge!(resource.template['Outputs']) unless resource.template['Outputs'].nil?
      end

      cloud_template = {'AWSTemplateFormatVersion' => '2010-09-09',
                  'Description' => description
      }
      cloud_template['Resources'] = resource_template if !resource_template.empty?
      cloud_template['Outputs'] = output_template if !output_template.empty?
      return cloud_template.delete_nil.to_json
    end
def template(options = {})
      require_options(options, [:resources])
      resources = options[:resources]
      description = options[:description] || 'This stack is created by Cloudster'
      resource_template = {}
      output_template = {}
      resources.each do |resource|
        resource_template.merge!(resource.template['Resources'])
        output_template.merge!(resource.template['Outputs']) unless resource.template['Outputs'].nil?
      end

      cloud_template = {'AWSTemplateFormatVersion' => '2010-09-09',
                  'Description' => description
      }
      cloud_template['Resources'] = resource_template if !resource_template.empty?
      cloud_template['Outputs'] = output_template if !output_template.empty?
      return cloud_template.delete_nil.to_json
    end
Initialize a Cloud instance

 ==== Notes
 options parameter must include values for :access_key_id and
 :secret_access_key in order to create a connection

 ==== Parameters
 * options<~Hash>
   * :access_key_id : A string containing the AWS access key ID (Required)
   * :secret_access_key : A string containing the AWS secret access key (Required)
   * :region : A string containing the region where the stack should be created/updated (Optional). Can be one of
     us-east-1(default), us-west-1, us-west-2, eu-west-1, ap-southeast-1, ap-northeast-1, ap-southeast-2, sa-east-1

 ==== Examples
   cloud = Cloudster::Cloud.new(
    :access_key_id => 'aws_access_key_id',
    :secret_access_key => 'aws_secret_access_key',
    :region => 'us-east-1'
   )
 Generates CloudFormation Template for the stack

 ==== Examples
   cloud = Cloudster::Cloud.new(
    :access_key_id => 'aws_access_key_id',
    :secret_access_key => 'aws_secret_access_key',
    :region => 'us-east-1'
   )

   cloud.template(:resources => [<AWS RESOURCES ARRAY>], :description => 'This is the description for the stack template')

 ==== Notes
 options parameter must include values for :resources

 ==== Parameters
 * options<~Hash> -
   * :resources : An array of Cloudster resource instances.  Defaults to {}.
   * :description : A string which will be used as the Description of the CloudFormation template.

 ==== Returns
 * JSON cloud formation template