To start using Serverless and access the AWS API you need to set the AWS API Access Key & Secret.
As a quick setup to get started you can export them as environment variables so they will be accessible to Serverless and the AWS SDK in your shell:
export AWS_ACCESS_KEY_ID=<key>
export AWS_SECRET_ACCESS_KEY=<secret>
serverless deploy
For a more permanent solution you can also set up credentials through the aws-cli
, or by configuring the credentials file of the aws-cli
directly. To set them up through the aws-cli
install it first the run aws configure
to configure the aws-cli and credentials. Serverless will automatically use those credentials. You can even set up a different profiles for different accounts, which can be used by Serverless as well.
$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: ENTER
You can also edit the credentials file which is located in ~/.aws/credentials
directly. Read more about that file in the AWS documentation