title: AWS CDK, creating an alias record for an existing S3 bucket in Route53
body: <p>I wonder how I could get an existing S3 bucket and create an alias record point to it using AWS CDK?</p>
  
  <p>So far so good :</p>
  
  <pre class="lang-js prettyprint-override"><code>const myExistingBucket = Bucket.fromBucketName(this, 'myExistingBucket', 'myExistingBucketName')
  
  new route53.ARecord(this, 'myAliasRecord', {
    zone: myHostedZone,
    target: route53.AddressRecordTarget.fromAlias(new route53_targets.BucketWebsiteTarget(myExistingBucket))
  });
  </code></pre>
  
  <p>And I got : <strong>Argument of type 'IBucket' is not assignable to parameter of type 'Bucket'</strong>.</p>
  
  <p><code>fromBucketArn()</code>, <code>fromBucketAttributes()</code> and <code>fromBucketName()</code> functions all return <code>IBucket</code> type, but the <code>BucketWebsiteTarget()</code> function need a <code>Bucket</code> type.</p>
  
  <p>So, how am I suppose to get a <code>Bucket</code> type from an existing one using AWS CDK?</p>