diff --git a/lib/plugins/aws/package/compile/events/http-api.js b/lib/plugins/aws/package/compile/events/http-api.js index 738019415df..3df5a678e50 100644 --- a/lib/plugins/aws/package/compile/events/http-api.js +++ b/lib/plugins/aws/package/compile/events/http-api.js @@ -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) diff --git a/test/unit/lib/plugins/aws/package/compile/events/http-api.test.js b/test/unit/lib/plugins/aws/package/compile/events/http-api.test.js index 5eb3fdd6897..4fe26907844 100644 --- a/test/unit/lib/plugins/aws/package/compile/events/http-api.test.js +++ b/test/unit/lib/plugins/aws/package/compile/events/http-api.test.js @@ -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', () => {