Skip to content

Commit e0c41d4

Browse files
jogoldmergify[bot]
andcommitted
fix(custom-resources): default timeout of 2 minutes for AwsCustomResource (#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>
1 parent 87befa6 commit e0c41d4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface AwsCustomResourceProps {
156156
/**
157157
* The timeout for the Lambda function implementing this custom resource.
158158
*
159-
* @default Duration.seconds(60)
159+
* @default Duration.minutes(2)
160160
*/
161161
readonly timeout?: cdk.Duration
162162
}
@@ -185,7 +185,7 @@ export class AwsCustomResource extends cdk.Construct implements iam.IGrantable {
185185
handler: 'index.handler',
186186
uuid: '679f53fa-c002-430c-b0da-5b7982bd2287',
187187
lambdaPurpose: 'AWS',
188-
timeout: props.timeout || cdk.Duration.seconds(60),
188+
timeout: props.timeout || cdk.Duration.minutes(2),
189189
role: props.role,
190190
});
191191
this.grantPrincipal = provider.grantPrincipal;

packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ test('encodes booleans', () => {
208208
});
209209
});
210210

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

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

224224
// THEN
225225
expect(stack).toHaveResource('AWS::Lambda::Function', {
226-
Timeout: 60
226+
Timeout: 120
227227
});
228228
});
229229

packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
]
154154
},
155155
"Runtime": "nodejs12.x",
156-
"Timeout": 60
156+
"Timeout": 120
157157
},
158158
"DependsOn": [
159159
"AWS679f53fac002430cb0da5b7982bd2287ServiceRoleDefaultPolicyD28E1A5E",

0 commit comments

Comments
 (0)