title: Why does the AWS CLI error "You must specify a region." occur when I have a region specified in the ~/.aws/config file?
body: <p>For AWS CLI configuration and credentials files how do you connect the entries in these files? It is like my credentials work, but my config file does not, though the default profile works.</p>
  
  <p>I am presently getting an error: <code>You must specify a region. You can also configure your region by running "aws configure"</code> when running something like:</p>
  
  <pre><code>aws ec2 describe-instances --profile devenv
  </code></pre>
  
  <p>However if I run the command:</p>
  
  <pre><code>aws s3api list-buckets --profile devenv
  </code></pre>
  
  <p>then I get a sensible response, a list of buckets.</p>
  
  <p>Here are the credentials and config files:</p>
  
  <p>~/.aws/credentials</p>
  
  <pre><code>[default]
  aws_access_key_id = AAAAAAAAAA
  aws_secret_access_key = BBBBBBBBBB
  
  [devenv]
  aws_access_key_id = CCCCCCCCCC
  aws_secret_access_key = DDDDDDDDDD
  
  [testenv]
  aws_access_key_id = EEEEEEEEEE
  aws_secret_access_key = FFFFFFFFFF
  </code></pre>
  
  <p>~/.aws/config</p>
  
  <pre><code>[default]
  region = us-east-1
  output = json
  
  [devenv]
  region = us-west-2
  output = json
  
  [testenv]
  region = us-east-2
  output = json
  </code></pre>