title: How do I apply a lifecycle rule to an EXISTING s3 bucket in Terraform?
body: <p>New to Terraform. Trying to apply a lifecycle rule to an existing s3 bucket declared as a datasource, but I guess I can't do that with a datasource - throws an error. Here's the gist of what I'm <em>trying</em> to achieve:</p>
  <pre><code>data &quot;aws_s3_bucket&quot; &quot;test-bucket&quot; {
    bucket = &quot;bucket_name&quot;
    lifecycle_rule {
      id = &quot;Expiration Rule&quot;
      enabled = true
      prefix = &quot;reports/&quot;
      expiration {
        days = 30
      }
    }
  }
  </code></pre>
  <p>...and if this were a resource, not a datasource, then it would work. How can I apply a lifecycle rule to an s3 bucket declared as a data source? Google Fu has yielded little in the way of results. Thanks!</p>