Setting up the Serverless Framework with AWS in just 5 minutes!


If you want to get started with serverless, this article will cover setting up your AWS User, installing Serverless Framework and configuring your credentials.

Creating Your Serverless User

To allow serverless to do work on your account, you need to set up a user for it. To do this, navigate into AWS and search for “IAM” (Identity and Access Management).

Once in the IAM Page, click on Users in the list on the left hand side. This will open the list of users on your account. From here we’ll be clicking Add user.

We need to create a user which has Programmatic access and I’ve called my ServerlessAccount but the name doesn’t matter too much.

Next we need to give the user some permissions. When in the permissions screen, select Attach existing policies directly and then select AdministratorAccess. This will give our serverless framework permission to create all of the resources it needs to.

We don’t need to add any tags, so we can move straight onto Review.

In the review window, you’ll see the user has been given an Access key ID and a Secret access key. We’ll be needing those in the next part so keep this page open.

Serverless Install and Configuration

Now that we’ve created our user, we need to install the Serverless Framework on our machine.

Open up a terminal and run this command to install serverless globally on your computer. If you haven’t got npm or node installed check out this article.

npm install -g serverless

Now that we’ve got serverless installed, we need to set up the credentials for serverless to use. Run this command, putting your access key ID and Secret access key in the correct places.

serverless config credentials --provider aws --key ${Your access key ID} --secret ${Your secret access key} --profile serverlessUser

Once this has been run, you’re all set up with serverless. You can use serverless templates to create a repo with some of the setup already completed.

serverless create --template aws-nodejs --path ${Your Service Name}

Sam Williams

Sam is a Serverless Obsessive who runs Complete Coding, helping developers learn Serverless and companies make the most of the competitive advantage that Serverless gives them. Previous projects include: - Designing a chat platform that currently resolves over 250,000 customer inquiries a month for international retailers and local government - Architecting a backend system to support a 3D clothing visualisation tool - Building a solution to manage millions of dollars of communication software - Designing a "Video Editing in the Cloud" platform, enabling everyone from movie studios to indie film makers to harness the power of the Cloud - without needing to be cloud experts. - Launching a profitable Serverless Startup in under 30 days He has also been teaching cloud-based software development for 5 years and has taught Serverless development to thousands of people. The Complete Coding Youtube channel now has over 15,000 subscribers and over 1 million views

Recent Posts