# Reference serverless framework generated lambda in cloudformation template

**URL:** <https://forum.serverless.com/t/reference-serverless-framework-generated-lambda-in-cloudformation-template/5040>\
**Category:** Serverless Framework\
**Created:** [July 11, 2018, 1:08pm UTC](https://forum.serverless.com/t/reference-serverless-framework-generated-lambda-in-cloudformation-template/5040 "2018-07-11T13:08:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcongy](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@mcongy](https://forum.serverless.com/u/mcongy)\
**Post date:** [July 11, 2018, 1:08pm UTC](https://forum.serverless.com/t/reference-serverless-framework-generated-lambda-in-cloudformation-template/5040/1 "2018-07-11T13:08:37Z")

</div>

Hello,

What is the easiest way to reference a serverless framework generated lambda function in CF template?

Sorry if this question has already been answered, but I haven’t been able to find an answer to this question in the docs or on this forum.

Thanks!

---

<div class="post-metadata">

**Author:** ![jeremydaly](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jeremydaly/32/2104_2.png) [@jeremydaly](https://forum.serverless.com/u/jeremydaly)\
**Post date:** [July 11, 2018, 3:46pm UTC](https://forum.serverless.com/t/reference-serverless-framework-generated-lambda-in-cloudformation-template/5040/2 "2018-07-11T15:46:33Z")

</div>

Do you want to reference a Serverless generated function in a DIFFERENT CloudFormation template? In that case you can reference resources by referencing the stack they are in: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-stack.html)

If you want to reference in the same CloudFormation template, you can use the logicalIds.

---

<div class="post-metadata">

**Author:** ![mcongy](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@mcongy](https://forum.serverless.com/u/mcongy)\
**Post date:** [July 17, 2018, 3:33pm UTC](https://forum.serverless.com/t/reference-serverless-framework-generated-lambda-in-cloudformation-template/5040/3 "2018-07-17T15:33:56Z")

</div>

I wanted to reference the function in the same stack.

What I actually had to do is use the logical id.  
Logical id for serverless autogenerated lambda is:  
the lambda function name with the “LambdaFunction” postfix, everything in PascalCase

example:

```
functions:
  random-name:
    handler: lambda/random-name.default

```

The logical id is `RandomNameLambdaFunction`
