# API Gateway REST -> HTTP Migration

## HTTP API migration

* Duplicate the current stage config and rename the stage, and add the below extra config to support HTTP API, we'll use this new stage for HTTP deployment testing.

```json
{
  "dev_http": {
    ...
    "project_name": "project_name_http",
    "api_name": "api_name_http", # Only If this key present
    "use_http_api": true,
    ...
  }
}
```

* Update the env variables of the new lambda function deployed above.
* Update domain mapping to newly deployed API. See [Change Custom domain to regional endpoint](#change-custom-domain-to-regional-endpoint)
* Wait for some time to reflect the above API mapping changes (\~2 min)
* check whether the new HTTP API deployment is working properly, if you're unable to access the API try it in an incognito window.
* **Optional**: remove `domain` from `zappa_settings.json` in the original stage and undeploy the original/old REST API deployment using Zappa (`zappa undeploy <stage>`).

## Change Custom domain to regional endpoint

* Choose the custom domain name you want in the API gateway console.
* update TLS version to 1.2
* Now click on the configurations tab -> Edit -> add regional endpoint with your ACM certificate.
* update route53 record to "A type record" and point to above created regional endpoint API gateway domain name
* Delete the `Endpoint configuration (edge-optimized)` in the Configuration tab.
* Delete rest API mapping.
* Add mapping with newly deployed HTTP API
* Test the API again after sometime


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.techbytes.app/devops-docs/processes/api-gateway-rest-greater-than-http-migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
