# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > states-timeout A workflow that triggers the _States.Timeout_ error. Parameters: MinimumExecutionSeconds: Description: The minimum number of seconds for the LongRunningFunction to execute. Any value greater than 5 will cause a States.Timeout error. Type: Number Default: 10 MinValue: 0 MaxValue: 30 Resources: LongRunningFunction: Type: AWS::Serverless::Function Properties: CodeUri: functions/long-running-function/ Handler: long-running-function Runtime: go1.x Timeout: 31 Environment: Variables: MINIMUM_EXECUTION_SECONDS: !Ref MinimumExecutionSeconds StatesTimeoutStateMachine: Type: AWS::Serverless::StateMachine Properties: Name: States-Timeout Policies: - LambdaInvokePolicy: FunctionName: !Ref LongRunningFunction DefinitionUri: statemachine/states-timeout.asl.json DefinitionSubstitutions: LongRunningFunctionArn: !GetAtt LongRunningFunction.Arn