# Add existing Lambda to Cloudfront behaviour (Viewer Request)

**URL:** <https://forum.serverless.com/t/add-existing-lambda-to-cloudfront-behaviour-viewer-request/16904>\
**Category:** Serverless Architectures\
**Tags:** aws, lambda\
**Created:** [March 17, 2022, 7:27am UTC](https://forum.serverless.com/t/add-existing-lambda-to-cloudfront-behaviour-viewer-request/16904 "2022-03-17T07:27:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![james\_shcc](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@james\_shcc](https://forum.serverless.com/u/james_shcc)\
**Post date:** [March 17, 2022, 7:27am UTC](https://forum.serverless.com/t/add-existing-lambda-to-cloudfront-behaviour-viewer-request/16904/1 "2022-03-17T07:27:52Z")

</div>

I am trying to link an existing Lambda@Edge to the Viewer Request during the deploy. The Lambda does not change and is uesd on one stage for password protecting access to the site.

Where can I add this behaviour in the template to auto deploy on each deploy? A new deploy currently removes the protection and requires manually adding each time
