Skip to content

Commit daab620

Browse files
committed
feat: add timeout option
1 parent 7a3bf2f commit daab620

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ export interface Notifications {
1212
// readonly slack?: Slack;
1313
}
1414

15+
export interface TimeoutOption {
16+
readonly stateMachineTimeout?: Duration;
17+
}
18+
1519
export interface StepFunctionsExecutionStatueChangeNotificationStackProps extends StackProps {
1620
// readonly targetResource: TargetResource;
1721
readonly enableRule?: boolean;
1822
readonly notifications?: Notifications;
1923
// readonly resourceNamingOption?: ResourceNamingOption;
24+
readonly timeoutOption?: TimeoutOption;
2025
}
2126

2227
export class StepFunctionsExecutionStatueChangeNotificationStack extends Stack {
@@ -38,8 +43,13 @@ export class StepFunctionsExecutionStatueChangeNotificationStack extends Stack {
3843
// 👇 Create State Machine
3944
const stateMachine = new NotificationStateMachine(this, 'StateMachine', {
4045
stateMachineName: undefined,
41-
timeout: Duration.minutes(1),
4246
notificationTopic: topic,
47+
timeout: (() => {
48+
if (props.timeoutOption?.stateMachineTimeout) {
49+
return props.timeoutOption?.stateMachineTimeout;
50+
}
51+
return Duration.minutes(3);
52+
})(),
4353
});
4454

4555
// @ts-ignore

0 commit comments

Comments
 (0)