# RequestParameters are not generated in Cloudformation

**URL:** <https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517>\
**Category:** Serverless Framework\
**Created:** [August 17, 2017, 11:31am UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517 "2017-08-17T11:31:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkTim](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@gkTim](https://forum.serverless.com/u/gkTim)\
**Post date:** [August 17, 2017, 11:31am UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/1 "2017-08-17T11:31:27Z")

</div>

Hi,

I have the following entry in my serverless.yml

```
handler: src/handlers/users.getById
name: SKUsersGetById
events:
  - http:
      path: users/{id}
      method: get
      request:
        parameters:
          paths:
            id: true
      cors: true

```

It is not generating the path parameters in the Cloudformation file. So the AWS SDK is not generated correctly and no params are included in the generated sdk.

Am I doing something wrong or is this a bug in serverless?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [August 17, 2017, 9:43pm UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/2 "2017-08-17T21:43:36Z")

</div>

I’ve never tried to define the variables in the `path` and `request` properties at the same time (although I can see where you got the example from in the docs).

Try this definition:

```auto
handler: src/handlers/users.getById
name: SKUsersGetById
events:
  - http:
      path: users/{id}
      method: get
      cors: true

```

You’ll still see the `id` variable in the `event.pathParameters` object (i.e. `event.pathParameters.id`).

---

<div class="post-metadata">

**Author:** ![gkTim](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@gkTim](https://forum.serverless.com/u/gkTim)\
**Post date:** [August 18, 2017, 6:04am UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/3 "2017-08-18T06:04:35Z")

</div>

Hi,

tanks for your answer.  
I have done this before.  
The lambda functions are working this way but AWS then doesn’t have the path parameters in the generated SDK.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [August 18, 2017, 9:15am UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/4 "2017-08-18T09:15:25Z")

</div>

Sorry, I don’t understand what you mean by “generated SDK”.

If you go to `/users/test` do you see the value “test” in the `event.pathParameters.id` property? If so, then path parameter is being mapped to the variable defined.

---

<div class="post-metadata">

**Author:** ![gkTim](https://avatars.discourse-cdn.com/v4/letter/g/3ab097/32.png) [@gkTim](https://forum.serverless.com/u/gkTim)\
**Post date:** [August 18, 2017, 10:46am UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/5 "2017-08-18T10:46:39Z")

</div>

I mean the API Gateway Client SDK Generation on AWS after you deploy your API.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [August 18, 2017, 7:59pm UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/6 "2017-08-18T19:59:36Z")

</div>

Ah, now I understand.

I’ve never used that myself, so I’m not sure what’s missing to connect your `serverless.yml` function definition and the SDK definition.

---

<div class="post-metadata">

**Author:** ![cdichiara](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cdichiara](https://forum.serverless.com/u/cdichiara)\
**Post date:** [August 22, 2017, 8:28pm UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/7 "2017-08-22T20:28:03Z")

</div>

Hi @gkTim, this might help:

```
resources:
  Resources:
    # The following are workarounds for the current inability to define querystrings while using
    # lambda-proxy integration.
    # Be sure to remove them once it's been fixed or a plugin has been developed!
    # And be sure to add any new querystring-needing functions here ...
    # you get their full name out of .serverless/cloudformation-template-update-stack.json:
    ApiGatewayMethodNotificationsDeviceidVarDelete:
      Properties:
        RequestParameters:
          method.request.path.deviceId: true
```

---

<div class="post-metadata">

**Author:** ![Gonzasestopal](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gonzasestopal/32/3094_2.png) [@Gonzasestopal](https://forum.serverless.com/u/Gonzasestopal)\
**Post date:** [February 28, 2019, 5:57pm UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/9 "2019-02-28T17:57:40Z")

</div>

I’ve been looking ages for this. Thank you. (Sorry to revive this old post, but after 2 years this problem still exist)

---

<div class="post-metadata">

**Author:** ![cdichiara](https://avatars.discourse-cdn.com/v4/letter/c/71e660/32.png) [@cdichiara](https://forum.serverless.com/u/cdichiara)\
**Post date:** [March 1, 2019, 12:26pm UTC](https://forum.serverless.com/t/requestparameters-are-not-generated-in-cloudformation/2517/10 "2019-03-01T12:26:38Z")

</div>

Hey that’s awesome … that’s why I posted it. 🙂 Yeah I don’t know how many people are using the Generated SDK in this crowd.
