title: Gitlab runner unable to run aws commands
body: <p>I am trying to run GitLab's job using their shared Runners,<br>
  I've created a <code>.gitlab-ci.yml</code> and kept it at my project's root,<br>
  Configured AWS creds as the environment variables -<br></p>
  
  <pre><code>AWS_ACCESS_KEY_ID
  AWS_SECRET_ACCESS_KEY
  AWS_DEFAULT_REGION
  </code></pre>
  
  <p>under <code>Settings -&gt; CI / CD -&gt; Variables</code>
  <a href="https://i.stack.imgur.com/VUVkp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VUVkp.png" alt="enter image description here"></a></p>
  
  <p>Double checked the branch I've trying to build from is <code>protected</code><br></p>
  
  <p><strong>Following is my .gitlab-ci.yml -</strong></p>
  
  <pre><code>stages:
      - build
  
  build:
      image: python:latest
      stage: build
      script:
              - apt-get update
              - apt-get install -y zip unzip
              - pip install awscli
              - mkdir ~/.aws/
              - touch ~/.aws/credentials
              - pip install awscli
              - printf "[eb-cli]\naws_access_key_id = %s\naws_secret_access_key = %s\nregion = %s\n" "$AWS_ACCESS_KEY_ID" "$AWS_SECRET_ACCESS_KEY" "$AWS_DEFAULT_REGION" &gt;&gt; ~/.aws/credentials
              - bash cicdScript.sh
  </code></pre>
  
  <p><strong>CICD script has the aws command -</strong><br></p>
  
  <pre><code>$(aws s3 ls)
  </code></pre>
  
  <p><strong>But I still get the following error -</strong></p>
  
  <pre><code>Unable to locate credentials. You can configure credentials by running "aws configure".
  </code></pre>
  
  <p><strong>Reference -</strong><br>
  <a href="https://medium.com/faun/continuous-static-upload-to-aws-s3-using-gitlab-runners-17f0260a5af2" rel="noreferrer">https://medium.com/faun/continuous-static-upload-to-aws-s3-using-gitlab-runners-17f0260a5af2</a></p>