def create_or_update(options)
      options = options.dup
      if (template_data = options.delete(:template))
        options[:template_body] = MultiJson.dump(template_data)
      end
      if (parameters = options[:parameters])
        options[:parameters] = Parameters.new(parameters).to_a
      end
      if (tags = options[:tags])
        options[:tags] = normalize_tags(tags)
      end
      if (policy_data = options.delete(:stack_policy))
        options[:stack_policy_body] = MultiJson.dump(policy_data)
      end
      if (policy_data = options.delete(:stack_policy_during_update))
        options[:stack_policy_during_update_body] = MultiJson.dump(policy_data)
      end
      options[:capabilities] ||= ["CAPABILITY_NAMED_IAM"]
      delete if ALMOST_DEAD_STATUSES.include?(status)
      update(options)
    rescue NoSuchStack
      create(options)
    end
def create_or_update(options)
      options = options.dup
      if (template_data = options.delete(:template))
        options[:template_body] = MultiJson.dump(template_data)
      end
      if (parameters = options[:parameters])
        options[:parameters] = Parameters.new(parameters).to_a
      end
      if (tags = options[:tags])
        options[:tags] = normalize_tags(tags)
      end
      if (policy_data = options.delete(:stack_policy))
        options[:stack_policy_body] = MultiJson.dump(policy_data)
      end
      if (policy_data = options.delete(:stack_policy_during_update))
        options[:stack_policy_during_update_body] = MultiJson.dump(policy_data)
      end
      options[:capabilities] ||= ["CAPABILITY_NAMED_IAM"]
      delete if ALMOST_DEAD_STATUSES.include?(status)
      update(options)
    rescue NoSuchStack
      create(options)
    end
Create or update the stack.

 @param [Hash] options create/update options
   accepts a superset of the options supported by
   +Aws::CloudFormation::Stack#update+
   (see http://docs.aws.amazon.com/sdkforruby/api/Aws/CloudFormation/Stack.html#update-instance_method)
 @option options [Array<String>] :capabilities (CAPABILITY_NAMED_IAM)
   list of capabilities required for stack template
 @option options [boolean] :disable_rollback (false)
   if true, disable rollback if stack creation fails
 @option options [String] :notification_arns
   ARNs for the Amazon SNS topics associated with this stack
 @option options [String] :on_failure (ROLLBACK)
   if stack creation fails: DO_NOTHING, ROLLBACK, or DELETE
 @option options [Hash, Array<Hash>] :parameters
   stack parameters, either as a Hash, or an Array of
   +Aws::CloudFormation::Types::Parameter+ structures
 @option options [Hash, Array<Hash>] :tags
   stack tags, either as a Hash, or an Array of
   +Aws::CloudFormation::Types::Tag+ structures
 @option options [Array<String>] :resource_types
   resource types that you have permissions to work with
 @option options [Hash] :stack_policy
   stack policy, as Ruby data
 @option options [String] :stack_policy_body
   stack policy, as JSON
 @option options [String] :stack_policy_url
   location of stack policy
 @option options [Hash] :stack_policy_during_update
   temporary stack policy, as Ruby data
 @option options [String] :stack_policy_during_update_body
   temporary stack policy, as JSON
 @option options [String] :stack_policy_during_update_url
   location of temporary stack policy
 @option options [Hash] :template
   stack template, as Ruby data
 @option options [String] :template_body
   stack template, as JSON or YAML
 @option options [String] :template_url
   location of stack template
 @option options [Integer] :timeout_in_minutes
   stack creation timeout
 @option options [boolean] :use_previous_template
   if true, reuse the existing template
 @return [String] resulting stack status
 @raise [Stackup::StackUpdateError] if operation fails