title: AWS CDK: how to target API Gateway API from Route53
body: <p>I have an existing domain name registered with AWS Route53 and I have set up a custom domain name in API Gateway. In the console i can configure things such that xxxxxx.zenxxxxxxfoundry.com from the outside, actually reaches the API Gateway API and then on through to my Lambda functions.</p>
  
  <p>Now I want to achieve this with AWS CDK.</p>
  
  <p>I have tried the following:</p>
  
  <pre class="lang-js prettyprint-override"><code>    const zone = route53.HostedZone.fromHostedZoneId(this, 'ZenithWebFoundryZone', 'ZXXXXXX04V8134');
      new route53.AliasRecord(this, 'BlogAPIRecord', {
        zone: zone,
        recordName: 'xxxxxx.zenxxxxxxfoundry.com',
        target: {
          bind: (): route53.AliasRecordTargetProps =&gt; ({
            dnsName: 'd-xxxxxxy00g.execute-api.ap-southeast-2.amazonaws.com',
            hostedZoneId: 'ZXXXXXX04V8134'
          })
        }
      });
  </code></pre>
  
  <p>which builds ok <code>npm run build</code> but when I run <code>cdk synth</code> I get the rather obtuse error:</p>
  
  <pre><code>$ cdk synth
  HostedZone.fromHostedZoneId doesn't support "zoneName"
  Subprocess exited with error 1
  </code></pre>
  
  <p>Switching on <code>--trace</code> didn't really help much: the additional info:</p>
  
  <pre><code>Error: Subprocess exited with error 1
      at ChildProcess.proc.on.code (/Users/mikecoxon/.npm-packages/lib/node_modules/aws-cdk/lib/api/cxapp/exec.ts:108:23)
      at ChildProcess.emit (events.js:189:13)
      at ChildProcess.EventEmitter.emit (domain.js:441:20)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
  </code></pre>
  
  <p>I have looked through the whole stack script and there is no reference to <code>zoneName</code> anywhere. Does anyone know where this error comes from?</p>