# Deploy API Gateway and Lambda in different Security Group

**URL:** <https://forum.serverless.com/t/deploy-api-gateway-and-lambda-in-different-security-group/16928>\
**Category:** Serverless Architectures\
**Tags:** aws, lambda, api-gateway\
**Created:** [March 22, 2022, 10:46pm UTC](https://forum.serverless.com/t/deploy-api-gateway-and-lambda-in-different-security-group/16928 "2022-03-22T22:46:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![debarghya87](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@debarghya87](https://forum.serverless.com/u/debarghya87)\
**Post date:** [March 22, 2022, 10:46pm UTC](https://forum.serverless.com/t/deploy-api-gateway-and-lambda-in-different-security-group/16928/1 "2022-03-22T22:46:19Z")

</div>

Hi All,

Please bear with me as I have just stared working on serverless and I have many gaps in my understanding.  
I have created a lambda function and an API gateway and able to deploy it inside a VPC and same security group using serverless.  
But want to know how can I deploy the API gateway and Lambda function inside the same VPC but attached to different security groups.

I am not able to find any examples that match my criteria. Any guidance/samples would be highly appreciated.
