# AWS - Serverless

# **Set the serverless framework**
You first have to set your machine to work as serverless.
for that first, you have to create an IAM user name it serverless account and get it programmatic access with admin privileges
Note the access key and secret key
now go to your terminal window

-  npm install -g serverless

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609607181578/x9BpFT-Tc.png)


- serverless config credentials --provider aws --key AKIAIOSFODNN7EXAMPLE --secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY --profile ServerlessUser

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609607291015/ykq4mcpwK.png)

# **Create your first serverless project**

Now we will create our first serverless project using AWS and node js.
This will be a template project to get started with the AWS Lambda service.
Get back to your terminal window and type the following commands

- serverless create --template aws-nodejs --path myServerlessProject

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609607865856/QEiX4Jb-k.png)

You will get two files in that project the first one is handler.js and the other one is serverless.yml
Add your profile name which you have written while writing the credentials in the serverless.fml file

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609608013078/JQn0hluHk.png)

Now open your terminal in the same directory and write 

- sls deploy

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1609608097671/ws3mGXIfh.png)

To check all this get back to your AWS account and in the console find the Lambda service. There you will find a new function named "myServerlessProject"

