Resources:
  ScheduledFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO
      Handler: hello.handler
      Runtime: python2.7
      Events:
        Schedule:
          Type: Schedule
          Properties:
            Schedule: rate(1 minute)
  TriggeredFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: s3://sam-demo-bucket/hello.zip?versionId=3Tcgv52_0GaDvhDva4YciYeqRyPnpIcO
      Handler: hello.handler
      Runtime: python2.7
      Events:
        OnTerminate:
          Type: CloudWatchEvent
          Properties:
            EventBusName: ExternalEventBridge
            Pattern:
              detail:
                state:
                - terminated