Skip to content

Commit 629e963

Browse files
shivlaksElad Ben-Israel
authored and
Elad Ben-Israel
committed
fix(cli): update TypeScript lib init template (#3134)
Aligning with SQS construct to use `visibilityTimeout` as well as using `Duration` as the type.
1 parent 16345dc commit 629e963

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/aws-cdk/lib/init-templates/lib/typescript/lib/index.template.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ export interface %name.PascalCased%Props {
77
/**
88
* The visibility timeout to be configured on the SQS Queue, in seconds.
99
*
10-
* @default 300
10+
* @default Duration.seconds(300)
1111
*/
12-
visibilityTimeout?: number;
12+
visibilityTimeout?: cdk.Duration;
1313
}
1414

1515
export class %name.PascalCased% extends cdk.Construct {
@@ -20,7 +20,7 @@ export class %name.PascalCased% extends cdk.Construct {
2020
super(scope, id);
2121

2222
const queue = new sqs.Queue(this, '%name.PascalCased%Queue', {
23-
visibilityTimeoutSec: props.visibilityTimeout || 300
23+
visibilityTimeout: props.visibilityTimeout || cdk.Duration.seconds(300)
2424
});
2525

2626
const topic = new sns.Topic(this, '%name.PascalCased%Topic');

0 commit comments

Comments
 (0)