Skip to content

Instantly share code, notes, and snippets.

@flomotlik flomotlik/
Last active Aug 3, 2016

What would you like to do?

Setting the AWS API Key & Secret

To start using Serverless and access the AWS API you need to set the AWS API Access Key & Secret.

Quick Setup

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

Advanced and longer term

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 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.