Skip to content

Commit

Permalink
fix(custom-resources): default timeout of 2 minutes for AwsCustomReso…
Browse files Browse the repository at this point in the history
…urce (#5658)

60 seconds turns out to be a bit on the short side when installing the latest SDK.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jogold and mergify[bot] committed Jan 6, 2020
1 parent 87befa6 commit e0c41d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export interface AwsCustomResourceProps {
/**
* The timeout for the Lambda function implementing this custom resource.
*
* @default Duration.seconds(60)
* @default Duration.minutes(2)
*/
readonly timeout?: cdk.Duration
}
Expand Down Expand Up @@ -185,7 +185,7 @@ export class AwsCustomResource extends cdk.Construct implements iam.IGrantable {
handler: 'index.handler',
uuid: '679f53fa-c002-430c-b0da-5b7982bd2287',
lambdaPurpose: 'AWS',
timeout: props.timeout || cdk.Duration.seconds(60),
timeout: props.timeout || cdk.Duration.minutes(2),
role: props.role,
});
this.grantPrincipal = provider.grantPrincipal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ test('encodes booleans', () => {
});
});

test('timeout defaults to 30 seconds', () => {
test('timeout defaults to 2 minutes', () => {
// GIVEN
const stack = new cdk.Stack();

Expand All @@ -223,7 +223,7 @@ test('timeout defaults to 30 seconds', () => {

// THEN
expect(stack).toHaveResource('AWS::Lambda::Function', {
Timeout: 60
Timeout: 120
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
]
},
"Runtime": "nodejs12.x",
"Timeout": 60
"Timeout": 120
},
"DependsOn": [
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E",
Expand Down

0 comments on commit e0c41d4

Please sign in to comment.