Hello!
I’m experiencing strange behavior while trying to deploy my lambdas using serverless framework. I’m using SSM integration and auto decryption to setup my environment variables directly in the serverless.yml file, as described here.
Serverless is unable to retrieve the encrypted parameters, according to this log:
Serverless Information ---------------------------------- ############################################################################################
# Completed after 260777ms
# 12 promises are in the following states:
# resolved: 6
# rejected: 2
# pending: 4
##########################################################################################
And then the build fails with this message:
Serverless Error ---------------------------------------
AWS provider credentials not found. Learn how to set up AWS provider credentials in our docs here: <http://slss.io/aws-creds-setup>.
This might seem like a serverless issue, but I can confirm this is only happening in CircleCI. I’m able to read the variables locally, and deploying from my machine also works. If I remove the ssm parameters from serverless.yml, it works fine.
This probably has something to do with circleCI not creating a correct ~/.aws/credentials file, because if I explicitly set the provider option in serverless, the error changes to this:
Error: Profile default does not exist
I’m setting AWS credentials this way (the circleCI environment variables are correctly configured):
sls config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_KEY
Any clue on this? Am I doing something wrong? Thanks!