title: Terraform: Error opening S3 bucket object source
body: <p>I'm new to Terraform and when trying to create an S3 static website bucket using modules, getting the below error:</p>
  <pre><code>Error: Error opening S3 bucket object source (index.html): open index.html: The system cannot find the file specified.
  </code></pre>
  <p>This is my folder structure:</p>
  <ul>
  <li>Terraform
  <ul>
  <li>My-Module
  <ul>
  <li>main.tf</li>
  <li>index.html</li>
  </ul>
  </li>
  <li>Use-My-Module
  <ul>
  <li>c1-main.tf</li>
  </ul>
  </li>
  </ul>
  </li>
  </ul>
  <p>Here's the code in my Terraform &gt; My-Module &gt; main.tf :</p>
  <pre><code>resource &quot;aws_s3_bucket&quot; &quot;mybucket&quot; {
    bucket = &quot;tf-static-web-test&quot;
    force_destroy = true
  }
  
  resource &quot;aws_s3_bucket_acl&quot; &quot;bucket-acl&quot; {
    acl = &quot;public-read&quot;
    bucket = aws_s3_bucket.mybucket.id
  }
  
  resource &quot;aws_s3_bucket_policy&quot; &quot;bucket-policy&quot; {
    bucket = aws_s3_bucket.mybucket.id
    policy = &quot;...&quot;
  }
  
  resource &quot;aws_s3_bucket_object&quot; &quot;s3object&quot; {
    bucket = aws_s3_bucket.mybucket.id
    content_type = &quot;text/html&quot;
    key = &quot;index.html&quot;
    source = &quot;index.html&quot;
  }
  
  resource &quot;aws_s3_bucket_website_configuration&quot; &quot;website&quot; {
    bucket = aws_s3_bucket.mybucket.id
    index_document {
      suffix = &quot;index.html&quot;
    }
    error_document {
      key = &quot;error.html&quot;
    }
  }
  </code></pre>
  <p>The code in Terraform &gt; Use-My-Module &gt; c1-main.tf is :</p>
  <pre><code>module &quot;my_static_website&quot; {
    source = &quot;../My-Module&quot;
  }
  </code></pre>
  <p>I have another file also with provider information and Terraform block in this same location.</p>
  <p>Please help me with this error.</p>