title: Serverless config credentials not working when serverless.yml file present
body: <p>We're trying to deploy our lambda using serverless on BitBucket pipelines, but we're running into an issue when running the <code>serverless config credentials</code> command.  This issue also happens in docker containers, and locally on our machines.</p>
  
  <p>This is the command we're running:</p>
  
  <pre><code>serverless config credentials --stage staging --provider aws --key $AWS_ACCESS_KEY --secret $AWS_ACCESS_SECRET
  </code></pre>
  
  <p>And it gives us the error:</p>
  
  <pre><code>Error: Profile default does not exist
  </code></pre>
  
  <p>The profile is defined in our serverless.yml file.  If we rename the serverless file before running the command, it works, and then we can then put the serverless.yml file back and successfully deploy.</p>
  
  <p>e.g.</p>
  
  <pre><code>            - mv serverless.yml serverless.old
              - serverless config credentials --stage beta --provider aws --key $AWS_ACCESS_KEY --secret $AWS_ACCESS_SECRET
              - mv serverless.old serverless.yml
  </code></pre>
  
  <p>We've tried adding the <code>--profile default</code> switch on there, but it makes no difference.</p>
  
  <p>It's worth noting that this wasn't an issue until we started to use the SSM Parameter Store within the serverless file, the moment we added that, it started giving us the <code>Profile default does not exist</code> error.</p>
  
  <p><strong>serverless.yml (partial)</strong></p>
  
  <pre><code>service: our-service
  
  provider:
    name: aws
    runtime: nodejs12.x
    region: eu-west-1
    profile: default
    stage: ${opt:stage, 'dev'}
  
    iamRoleStatements:
      - Effect: 'Allow'
        Action: 'ssm:GetParameter'
        Resource:
          - 'arn:aws:ssm:eu-west-1:0000000000:parameter/our-service-launchdarkly-key-dev'
          - 'arn:aws:ssm:eu-west-1:0000000000:parameter/our-service-launchdarkly-key-beta'
          - 'arn:aws:ssm:eu-west-1:0000000000:parameter/our-service-launchdarkly-key-staging'
          - 'arn:aws:ssm:eu-west-1:0000000000:parameter/our-service-launchdarkly-key-live'
      - Effect: 'Allow'
        Action: 'kms:Decrypt'
        Resource:
          - 'arn:aws:kms:eu-west-1:0000000000:key/alias/aws/ssm'
  
    environment:
      LAUNCH_DARKLY_SDK_KEY: ${self:custom.launchDarklySdkKey.${self:provider.stage}}
  
  custom:
    stages:
      - dev
      - beta
      - staging
      - live
  
    launchDarklySdkKey:
      dev: ${ssm:/our-service-launchdarkly-key-dev~true}
      beta: ${ssm:/our-service-launchdarkly-key-beta~true}
      staging: ${ssm:/our-service-launchdarkly-key-staging~true}
      live: ${ssm:/our-service-launchdarkly-key-live~true}
  
  plugins:
    - serverless-offline
    - serverless-stage-manager
  
  ...
  </code></pre>
  
  <p><strong>TLDR:</strong> serverless config credentials only works when serverless.yml isn't present, otherwise it complains about profile default not existing, only an issue when using SSM Param store in the serverless file.</p>