# Deploying several services under one apigateway not working

**URL:** <https://forum.serverless.com/t/deploying-several-services-under-one-apigateway-not-working/19880>\
**Category:** Serverless Framework\
**Tags:** api-gateway\
**Created:** [January 20, 2024, 12:56pm UTC](https://forum.serverless.com/t/deploying-several-services-under-one-apigateway-not-working/19880 "2024-01-20T12:56:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gchokeen](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gchokeen/32/7779_2.png) [@gchokeen](https://forum.serverless.com/u/gchokeen)\
**Post date:** [January 20, 2024, 12:56pm UTC](https://forum.serverless.com/t/deploying-several-services-under-one-apigateway-not-working/19880/1 "2024-01-20T12:56:22Z")

</div>

I was reading this [Share API Gateway and API Resources](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#share-api-gateway-and-api-resources) post. That mentioned we can deploy multiple service in one api gateway as like below

```auto
provider: 
  ...
  apiGateway:
    restApiId: xxxxxxxxxx # REST API resource ID. Default is generated by the framework
    restApiRootResourceId: xxxxxxxxxx # Root resource, represent as / path

```

Unfortunately its not working I have $default service which hosted in apigateway and I tried to deploy user-service, post-service under the same api gateway but it just create new api gateway instead of attaching in existing one.

I using `httpApi` events is that a matter ? Please someone help me to understand this problem

Framework Core: 3.38.0 (local) 3.38.0 (global)  
Plugin: 7.2.0  
SDK: 4.5.1

---

<div class="post-metadata">

**Author:** ![gchokeen](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gchokeen/32/7779_2.png) [@gchokeen](https://forum.serverless.com/u/gchokeen)\
**Post date:** [January 20, 2024, 3:04pm UTC](https://forum.serverless.com/t/deploying-several-services-under-one-apigateway-not-working/19880/2 "2024-01-20T15:04:22Z")

</div>

I found the solution [Serverless Framework - AWS Lambda Events - HTTP API (API Gateway v2)](https://www.serverless.com/framework/docs/providers/aws/events/http-api#reusing-http-api-in-different-services)

Need to use

```auto
provider:
  httpApi:
    id: xxxx # id of externally created HTTP API to which endpoints should be attached.

```
