:doc:`UserNotifications <../../notifications>` / Client / create_event_rule

*****************
create_event_rule
*****************



.. py:method:: UserNotifications.Client.create_event_rule(**kwargs)

  

  Creates an `EventRule <https://docs.aws.amazon.com/notifications/latest/userguide/glossary.html>`__ that is associated with a specified ``NotificationConfiguration``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/notifications-2018-05-10/CreateEventRule>`_  


  **Request Syntax**
  ::

    response = client.create_event_rule(
        notificationConfigurationArn='string',
        source='string',
        eventType='string',
        eventPattern='string',
        regions=[
            'string',
        ]
    )
    
  :type notificationConfigurationArn: string
  :param notificationConfigurationArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the ``NotificationConfiguration`` associated with this ``EventRule``.

    

  
  :type source: string
  :param source: **[REQUIRED]** 

    The matched event source.

     

    Must match one of the valid EventBridge sources. Only Amazon Web Services service sourced events are supported. For example, ``aws.ec2`` and ``aws.cloudwatch``. For more information, see `Event delivery from Amazon Web Services services <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level>`__ in the *Amazon EventBridge User Guide*.

    

  
  :type eventType: string
  :param eventType: **[REQUIRED]** 

    The event type to match.

     

    Must match one of the valid Amazon EventBridge event types. For example, EC2 Instance State-change Notification and Amazon CloudWatch Alarm State Change. For more information, see `Event delivery from Amazon Web Services services <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level>`__ in the *Amazon EventBridge User Guide*.

    

  
  :type eventPattern: string
  :param eventPattern: 

    An additional event pattern used to further filter the events this ``EventRule`` receives.

     

    For more information, see `Amazon EventBridge event patterns <https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html>`__ in the *Amazon EventBridge User Guide.*

    

  
  :type regions: list
  :param regions: **[REQUIRED]** 

    A list of Amazon Web Services Regions that send events to this ``EventRule``.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'arn': 'string',
          'notificationConfigurationArn': 'string',
          'statusSummaryByRegion': {
              'string': {
                  'status': 'ACTIVE'|'INACTIVE'|'CREATING'|'UPDATING'|'DELETING',
                  'reason': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **arn** *(string) --* 

        The ARN of the resource.

        
      

      - **notificationConfigurationArn** *(string) --* 

        The ARN of a ``NotificationConfiguration``.

        
      

      - **statusSummaryByRegion** *(dict) --* 

        A list of an ``EventRule``'s status by Region. Regions are mapped to ``EventRuleStatusSummary``.

        
        

        - *(string) --* 
          

          - *(dict) --* 

            Provides additional information about the current ``EventRule`` status.

            
            

            - **status** *(string) --* 

              The status of the ``EventRule``.

               

              
              * Values: 

                
                * ``ACTIVE`` 

                  
                  * The ``EventRule`` can process events.
                  

                
                 
                * ``INACTIVE`` 

                  
                  * The ``EventRule`` may be unable to process events.
                  

                
                 
                * ``CREATING`` 

                  
                  * The ``EventRule`` is being created. Only ``GET`` and ``LIST`` calls can be run.
                  

                
                 
                * ``UPDATING`` 

                  
                  * The ``EventRule`` is being updated. Only ``GET`` and ``LIST`` calls can be run.
                  

                
                 
                * ``DELETING`` 

                  
                  * The ``EventRule`` is being deleted. Only ``GET`` and ``LIST`` calls can be run.
                  

                
                

              
              

              
            

            - **reason** *(string) --* 

              A human-readable reason for ``EventRuleStatus``.

              
        
    
  
  
  **Exceptions**
  
  *   :py:class:`UserNotifications.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`UserNotifications.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`UserNotifications.Client.exceptions.ValidationException`

  
  *   :py:class:`UserNotifications.Client.exceptions.InternalServerException`

  
  *   :py:class:`UserNotifications.Client.exceptions.ConflictException`

  
  *   :py:class:`UserNotifications.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`UserNotifications.Client.exceptions.ThrottlingException`

  