anchor.diff:  require 'uri/http'
   require 'json'
   
  -def send_order_status(referer, headers, status, order_id, information, message = '')
  -  path = "/order_items/#{order_id}/provision_update"
  -  host = URI.parse(referer).host
  -  url = "http://#{host}#{path}"
  -  uri = URI.parse(url)
  +def send_order_status(endpoint, headers, status, information, message = '')
  +  uri = URI.parse(endpoint)
   
     information = information.merge('provision_status' => status.downcase)
     $evm.log('info', "send_order_status: Information: #{information}")
  
positive.code: security_groups = product_hash['security_groups']
  key_name = product_hash['key_name']
  instance_name = product_hash['instance_name']
  host = $evm.root['dialog_referer']
  headers = [$evm.root['dialog_email'], $evm.root['dialog_token']]
  
  # Configure AWS
  
negative.code:   instance = ec2.instances.create(options)
  rescue AWS::EC2::Errors::InvalidClientTokenId => e
    $evm.log('error', "CreateEC2: Invalid client token exception. Message: #{e.message}")
    send_order_status(endpoint, headers, 'CRITICAL', info, "#{e.message}")
    exit
  rescue AWS::EC2::Errors::InvalidParameterValue => e
    $evm.log('error', "CreateEC2: Invalid parameter exception. Message: #{e.message}")
    send_order_status(endpoint, headers, 'CRITICAL', info, "#{e.message}")
    exit
  rescue StandardError => e
    $evm.log('error', "CreateEC2: Could not create instance. Error: #{e}")
    send_order_status(endpoint, headers, 'CRITICAL', info, "#{e.message}")
    exit
  end
  
  