title: Terraform cloud : Import existing resource
body: <p>I am using <strong>terraform cloud</strong> to manage the state of the infrastructure provisioned in AWS.</p>
  
  <p>I am trying to use <code>terraform import</code> to import an existing resource that is currently not managed by terraform. </p>
  
  <p>I understand <code>terraform import</code> is a local only command. I have set up a workspace reference as follows: </p>
  
  <pre><code>terraform {
    required_version = "~&gt; 0.12.0"
  
    backend "remote" {
      hostname = "app.terraform.io"
      organization = "foo"
  
      workspaces {
        name = "bar"
      }
    }
  }
  </code></pre>
  
  <p>The AWS credentials are configured in the remote cloud workspace but terraform does not appear to be referencing the AWS credentials from the workspace but instead falls back trying to using the local credentials which points to a different AWS account. I would like Terraform to use the credentials by referencing the variables in the workspace when I run <code>terraform import</code>. </p>
  
  <p>When I comment out the locally configured credentials, I get the error: </p>
  
  <pre><code>Error: No valid credential sources found for AWS Provider.
  </code></pre>
  
  <p>I would have expected terraform to use the credentials configured in the workspace. </p>
  
  <p>Note that terraform is able to use the credentials correctly, when I run the plan/apply command directly from the cloud console. </p>