title: Pointing Two AWS Lambda Functions to Same Domain
body: <p>I am using the serverless framework and AWS Lambdas to deploy two function with different path names (<code>/message</code> and <code>/subscribe</code>) to my subdomain at <code>form.example.com</code>. </p>
  
  <p>I am using the <code>serverless-domain-manager</code> plugin for serverless and successfully configured my domain for the <code>/message</code> function using <code>serverless create_domain</code>, but since I also needed to do that for <code>/subscribe</code> I tried to follow the same process receiving messages that the domain already existed and caught an error <code>Error: Unable to create basepath mapping.</code>. </p>
  
  <p>After flipping a configuration (<code>createRoute53Record: false</code>) and re-running it started to work, but now when I run <code>sls deploy</code> for my <code>/message</code> function I get the error message I used to see for <code>/subscribe</code>.</p>
  
  <p>Error (from <code>sls deploy</code>):</p>
  
  <pre><code>layers:
    None
  
    Error --------------------------------------------------
  
    Error: Unable to create basepath mapping.
  
  
       For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
  </code></pre>
  
  <p>Here is my config for the <code>serverless-domain-manager</code>:</p>
  
  <pre><code>plugins:
    - serverless-offline
    - serverless-domain-manager
  
  custom:
    transactionDomain:
      dev: ${file(./local-keys.yml):transactionDomain}
      prod: ${ssm:mg-production-transaction-domain~true}
    newsletterDomain:
      dev: ${file(./local-keys.yml):newsletterDomain}
      prod: ${ssm:mg-production-newsletter-domain~true}
    apiKey:
      dev: ${file(./local-keys.yml):apiKey}
      prod: ${ssm:mg-production-api-key~true}
    customDomain:
      domainName: form.example.com
      certificateName: 'www.example.com' //sub-domain is included in the certificate
      stage: 'prod'
      createRoute53Record: true
  </code></pre>
  
  <p>Does this have to do with the deployment of two functions to the same domain? Is there a proper process to allow that to happen?</p>