title: AWS CLI: The config profile could not be found
body: <p>Currently working on deploying a yml file to CloudFormation and I have created this profile called awsbootsrap but when my script runs I get an error. My script:</p>
  <pre><code>#!/bin/bash
  STACK_NAME=awsbootstrap
  REGION=us-east-2c
  CLI_PROFILE=awsbootstrap
  EC2_INSTANCE_TYPE=t2.micro
  
  # Deploy the CloudFormation template
  echo $CLI_PROFILE
  echo -e &quot;\n\n=========== Deploying main.yml ===========&quot;
  aws cloudformation deploy --region $REGION --profile $CLI_PROFILE --stack-name $STACK_NAME --template-file main.yml --no-fail-on-empty-changeset --capabilities CAPABILITY_NAMED_IAM --parameter-overrides EC2InstanceType=$EC2_INSTANCE_TYPE
  
  
  # If the deploy succeeded, show the DNS name of the created instance
  if [ $? -eq 0 ]; then
      aws cloudformation list-exports --profile awsbootstrap --query &quot;Exports[?Name=='InstanceEndpoint'].Value&quot;
  fi
  </code></pre>
  <p>where $CLI_PROFILE=awsbootstrap</p>
  <p>I get <strong>The config profile (awsbootstrap) could not be found</strong></p>
  <p>Running <code>aws configure list-profile</code> shows me my profile -&gt; awsbootstrap</p>
  <p>Running <code>aws configure list</code> shows</p>
  <pre><code>      Name                    Value             Type    Location
        ----                    -----             ----    --------
     profile                &lt;not set&gt;             None    None
  access_key                &lt;not set&gt;             None    None
  secret_key                &lt;not set&gt;             None    None
      region                &lt;not set&gt;             None    None
  </code></pre>
  <p>My <code>~/.aws/config</code> looks like this (have also tried with us-east-1 / us-east-2):</p>
  <pre><code>[profile awsbootstrap]
  region = us-east-2c
  output = json
  </code></pre>
  <p>My <code>~/.aws/credentials</code> looks like this:</p>
  <pre><code>[awsbootstrap]
  aws_access_key_id = redacted
  aws_secret_access_key = redacted
  </code></pre>
  <p>I have no env variables that are creating issues...</p>