Resources:
  TriggerStateMachine:
    Type: AWS::Serverless::StateMachine
    Properties:
      Type: STANDARD
      Definition:
        StartAt: TryDoSomething
        States:
          TryDoSomething:
            Type: Task
            Resource: !Sub arn:${AWS::Partition}:states:::states:startExecution.sync:2
            Parameters:
              StateMachineArn: !Ref MyStateMachine
            End: true
      Policies:
      - LambdaInvokePolicy:
          FunctionName: SomethingDoesNotMatter

  MyStateMachine:
    Type: AWS::Serverless::StateMachine
    Properties:
      Type: EXPRESS
      Definition:
        StartAt: Success
        States:
          Success:
            Type: Succeed
      Policies:
      - LambdaInvokePolicy:
          FunctionName: SomethingDoesNotMatter

  MyConnector:
    Type: AWS::Serverless::Connector
    Properties:
      Source:
        Id: TriggerStateMachine
      Destination:
        Id: MyStateMachine
      Permissions:
      - Read
      - Write
Metadata:
  SamTransformTest: true
