- Should have node 8.11.3 or later installed
- Should have a new AWS IAM User with full admin privileges
- Should have a text editor installed
- Should have the serverless framework installed
- Should have your AWS credentials configured in serverless
- Follow instructions here https://nodejs.org/en/download/package-manager/
- At the end, you should be able to run
node -v
from your command line and get a result like this...
$ node -v
v8.11.3
- You should also be able to run
npm -v
from your command line and should see...
$ npm -v
5.6.0
- If you already have an AWS account, skip to the next task. If you don't have an AWS account, use the following procedure to create one.
- To create an AWS account
- Open https://aws.amazon.com/, and then choose Create an AWS Account.
- Follow the online instructions.
- Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad.
- Note your AWS account ID, because you'll need it for the next task.
Services in AWS, such as AWS Lambda, require that you provide credentials when you access them, so that the service can determine whether you have permissions to access the resources owned by that service. The console requires your password. You can create access keys for your AWS account to access the AWS CLI or API. However, AWS doesn't recommend that you access AWS using the credentials for your AWS account. Instead, they recommend that you use AWS Identity and Access Management (IAM). Create an IAM user, add the user to an IAM group with administrative permissions, and then grant administrative permissions to the IAM user that you created. You can then access AWS using a special URL and that IAM user's credentials.
If you signed up for AWS, but you haven't created an IAM user for yourself, you can create one using the IAM console.
This workshop assumes you have a user (adminuser) with administrator privileges. When you follow the procedure, create a user with name adminuser
.
- To create an IAM user for yourself and add the user to an Administrators group
- Sign in to the Identity and Access Management (IAM) console at https://console.aws.amazon.com/iam/.
- In the navigation pane, choose
Users
, and then chooseAdd user
. - For
User name
, type a user name,adminuser
. - Select the check boxes next to
Programmatic access
andAWS Management Console access
- Select Custom password, and then type the new user's password in the text box.
- Note down your username and password for later use.
- Unselect the check box next to
Require password reset
. - Choose
Next: Permissions
. - On the
Set permissions for user
page, chooseAdd user to group
. - Choose
Create group.
- In the
Create group
dialog box, type the nameadmins
for the new group. - For
Filter
, chooseJob function
. - In the policy list, select the check box for
AdministratorAccess
. - Now choose
Create group
. - Back in the list of groups, ensure the check box is selected for your new group. Choose
Refresh
if necessary to see the group in the list. - Choose
Next: Review
to see the list of group memberships to be added to the new user. When you are ready to proceed, chooseCreate user
.
- Note down the following from the
Success
page- name of your IAM user
- AWS
Access key ID
- AWS
Secret access key
- You will need a text editor to follow along with this workshop.
- Suggested editors for Mac & Windows
- atom https://atom.io/
- sublime http://www.sublimetext.com/
- Run this command in CLI
npm install -g serverless
- After install is complete, you should be able to run
serverless -v
from your command line and get a result like this...
$ serverless -v
1.29.0
- Run this command in the command line to configure your AWS provider credentials
serverless config credentials -p aws -k [Your AWS Access Key ID] -s [Your AWS Secret Access Key]
- Run this command to login/signup on the Serverless Platform
$ serverless login
- In the Serverless Dashboard, create an app called "myapp-dev"