title: How to make Terraform to read AWS Credentials file?
body: <p>I am trying to create an AWS S3 bucket using terraform and this is my code:</p>
  <pre><code>provider &quot;aws&quot; {
    profile = &quot;default&quot;
    region  = &quot;ap-south-1&quot;
  }
  
  resource &quot;aws_s3_bucket&quot; &quot;first_tf&quot; {
    bucket = &quot;svk-pl-2909202022&quot;
    acl    = &quot;private&quot;
  }
  </code></pre>
  <p>I have manually created the &quot;Credentials&quot; file using Notepad and also removed the &quot;.txt&quot; extension using Powershell and stored that file in <code>C:\Users\terraform\.aws</code>, and that file is like this:</p>
  <pre><code>[default]
  aws_access_key_id=**************
  aws_secret_access_key=************
  </code></pre>
  <p>But when I try to run <code>terraform plan</code>, I get an error which says</p>
  <blockquote>
  <p>ERROR: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found</p>
  </blockquote>
  <p>Then, I also tried to create that &quot;Credentials&quot; file by installing AWS CLI, I ran the command</p>
  <pre><code>aws configure --profile terraform
  </code></pre>
  <p>where <code>terraform</code> was my username. So, it asked me to enter <code>aws_access_key_id</code> and <code>aws_secret_access_key</code>. and after entering all the credentials, I ran the command <code>terraform init</code>, which ran successfully but when I ran <code>terraform plan</code>, it shows the error again which says:</p>
  <blockquote>
  <p>ERROR: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found</p>
  </blockquote>