Skip to content

Commit 523fb9e

Browse files
committed
Document how to set AWS API Gateway integration timeout
1 parent 2588f46 commit 523fb9e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/events/apigateway.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ Summary:
5555
- [AWS X-Ray Tracing](#aws-x-ray-tracing)
5656
- [Tags / Stack Tags](#tags--stack-tags)
5757
- [Logs](#logs)
58+
- [Disable Default Endpoint](#disable-default-endpoint)
59+
- [Providing a custom stage name](#providing-a-custom-stage-name)
60+
- [Timeout](#timeout)
5861

5962
_Are you looking for tutorials on using API Gateway? Check out the following resources:_
6063

@@ -1867,3 +1870,33 @@ provider:
18671870
apiGateway:
18681871
stage: customStageName
18691872
```
1873+
1874+
## Timeout
1875+
1876+
By default, the timeout for API Gateway integration is 29 seconds.
1877+
You can change this by setting the `timeoutInMillis` property in the `apiGateway` configuration
1878+
and overriding it in the `http` event for specific functions.
1879+
1880+
**Note:** This is particularly useful if you have requested an increase to the API Gateway integration timeout soft limit
1881+
in AWS (which previously had a hard limit of 29 seconds).
1882+
1883+
```yml
1884+
provider:
1885+
apiGateway:
1886+
timeoutInMillis: 10000 # Default timeout of 10 seconds for all endpoints
1887+
1888+
functions:
1889+
fetch:
1890+
handler: handler.hello
1891+
events:
1892+
- http:
1893+
path: /posts/{id}
1894+
method: get
1895+
create:
1896+
handler: handler.bye
1897+
events:
1898+
- http:
1899+
path: /posts
1900+
method: post
1901+
timeoutInMillis: 40000 # Override: 40-second timeout for this endpoint
1902+
```

0 commit comments

Comments
 (0)