title: Terraform and S3 - How to upload files to an existing bucket
body: <p>How do you upload files to an existing s3 bucket(created out of terraform infrastructure) without destroying contents of bucket or re-creating bucket.</p>
  
  <pre><code>terraform {
    backend "s3" {
      bucket = "terraformtests"
      key    = "terraformstate.tf"
      region = "us-east-1"
    }
  }
  
  
  resource "aws_s3_bucket_object" "terraformtests" {
    bucket = "terraformtests"
    key    = "test/prod/1000/keys"
    source = "deploy"
    etag   = "${md5(file("keys"))}"
  
  }
  </code></pre>
  
  <p>This is what i have. It runs fine in the first run and uploads it to keyspace '1000'. When i edit it and re-run with 1001, the script attempts to destroy previously created file in test/prod/1000/keys. All i'm looking to do is</p>
  
  <ul>
  <li>Import existing table state without recreating it</li>
  <li>Add folders to keyspaces, without touching previous contents of table.</li>
  </ul>