title: AWS 'Bucket already exists' - how to "migrate" existing resources to CloudFormation?
body: <p>We have already created some infrastructure manually and with terraform, including some s3 buckets. In the future I would like to use pure CloudFormation to define the infrastructure as code.</p>
  
  <p>So I created a CloudFormation yaml definition which references an existing bucket:</p>
  
  <pre><code>AWSTemplateFormatVersion: '2010-09-09'
  Resources:
    TheBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: my-existing-bucket-name
  </code></pre>
  
  <p>When I try to apply it, execution fails, with CloudFormation stack event:</p>
  
  <pre><code>The following resource(s) failed to update: [TheBucket].
  12:33:47 UTC+0200   UPDATE_FAILED   AWS::S3::Bucket TheBucket
    my-existing-bucket-name already exists
  </code></pre>
  
  <p>How can I start managing <em>existing</em> resources with CloudFormation without recreating them? Or is it impossible by design?</p>