# YAML exception duplicated mapping key

**URL:** <https://forum.serverless.com/t/yaml-exception-duplicated-mapping-key/12207>\
**Category:** Serverless Framework\
**Tags:** aws, lambda\
**Created:** [August 6, 2020, 9:01pm UTC](https://forum.serverless.com/t/yaml-exception-duplicated-mapping-key/12207 "2020-08-06T21:01:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![codydiane87](https://avatars.discourse-cdn.com/v4/letter/c/e47774/32.png) [@codydiane87](https://forum.serverless.com/u/codydiane87)\
**Post date:** [August 6, 2020, 9:01pm UTC](https://forum.serverless.com/t/yaml-exception-duplicated-mapping-key/12207/1 "2020-08-06T21:01:12Z")

</div>

When I run  
serverless invoke local --function get --path mocks/get-event.json  
in my termal I get the following error message:  
duplicated mapping key in “/Users/user/notes-app-api/serverless.yml” at line 57, column 5:  
handler: get.main

The other handler is:  
handler: create.main

My whole yml file:  
service: notes-app-api

# Create an optimized package for our functions

package:  
individually: true

plugins:

- serverless-bundle # Package our functions with Webpack
- serverless-offline
- serverless-dotenv-plugin # Load .env as environment variables

provider:  
name: aws  
runtime: nodejs12.x  
stage: prod  
region: us-east-1

# These environment variables are made available to our functions

# under process.env.

environment:  
tableName: notes

# ‘iamRoleStatements’ defines the permission policy for the Lambda function.

# In this case Lambda functions are granted with permissions to access DynamoDB.

iamRoleStatements:  
- Effect: Allow  
Action:  
- dynamodb:DescribeTable  
- dynamodb:Query  
- dynamodb:Scan  
- dynamodb:GetItem  
- dynamodb:PutItem  
- dynamodb:UpdateItem  
- dynamodb:DeleteItem  
Resource: “arn:aws:dynamodb:us-east-1:_:_”

functions:

# Defines an HTTP API endpoint that calls the main function in create.js

# - path: url path is /notes

# - method: POST request

# - cors: enabled CORS (Cross-Origin Resource Sharing) for browser cross

# domain api call

# - authorizer: authenticate using the AWS IAM role

create:  
handler: create.main  
events:  
- http:  
path: notes  
method: post  
cors: true  
authorizer: aws\_iam

```
get:
# Defines an HTTP API endpoint that calls the main function in get.js
# - path: url path is /notes/{id}
# - method: GET request
handler: get.main
events:
  - http:
      path: notes/{id}
      method: get
      cors: true
      authorizer: aws_iam

```

I am at add a get note API in the [serverless-stack.com](http://serverless-stack.com). Does any one have any clues as to why it’s doing this and how to fix it?
