Skip to content

Commit

Permalink
fix: Ensure maximum API gateway timeout (#11453)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurriaan Proos committed Oct 19, 2022
1 parent f5b183a commit c5ca9b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/plugins/aws/package/compile/events/http-api.js
Expand Up @@ -624,6 +624,7 @@ Object.defineProperties(
IntegrationType: 'AWS_PROXY',
IntegrationUri: resolveTargetConfig(routeTargetData),
PayloadFormatVersion: funcHttpApi.payload || providerHttpApi.payload || '2.0',
TimeoutInMillis: 30000,
};
this.cfTemplate.Resources[
this.provider.naming.getHttpApiIntegrationLogicalId(routeTargetData.functionName)
Expand Down
Expand Up @@ -129,9 +129,9 @@ describe('lib/plugins/aws/package/compile/events/httpApi.test.js', () => {
expect(resource.Properties.RouteKey).to.equal(routeKey);
});

it('should let the default api gateway timeout by not setting the TimeoutInMillis property', () => {
it('should set the default api gateway timeout by setting the TimeoutInMillis property', () => {
const resource = cfResources[naming.getHttpApiIntegrationLogicalId('foo')];
expect(resource.Properties.TimeoutInMillis).to.be.undefined;
expect(resource.Properties.TimeoutInMillis).to.equal(30000);
});

it('should configure lambda permissions', () => {
Expand Down

0 comments on commit c5ca9b7

Please sign in to comment.