:doc:`RDS <../../rds>` / Client / start_activity_stream

*********************
start_activity_stream
*********************



.. py:method:: RDS.Client.start_activity_stream(**kwargs)

  

  Starts a database activity stream to monitor activity on the database. For more information, see `Monitoring Amazon Aurora with Database Activity Streams <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/DBActivityStreams.html>`__ in the *Amazon Aurora User Guide* or `Monitoring Amazon RDS with Database Activity Streams <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.html>`__ in the *Amazon RDS User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/StartActivityStream>`_  


  **Request Syntax**
  ::

    response = client.start_activity_stream(
        ResourceArn='string',
        Mode='sync'|'async',
        KmsKeyId='string',
        ApplyImmediately=True|False,
        EngineNativeAuditFieldsIncluded=True|False
    )
    
  :type ResourceArn: string
  :param ResourceArn: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the DB cluster, for example, ``arn:aws:rds:us-east-1:12345667890:cluster:das-cluster``.

    

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

    Specifies the mode of the database activity stream. Database events such as a change or access generate an activity stream event. The database session can handle these events either synchronously or asynchronously.

    

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

    The Amazon Web Services KMS key identifier for encrypting messages in the database activity stream. The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key.

    

  
  :type ApplyImmediately: boolean
  :param ApplyImmediately: 

    Specifies whether or not the database activity stream is to start as soon as possible, regardless of the maintenance window for the database.

    

  
  :type EngineNativeAuditFieldsIncluded: boolean
  :param EngineNativeAuditFieldsIncluded: 

    Specifies whether the database activity stream includes engine-native audit fields. This option applies to an Oracle or Microsoft SQL Server DB instance. By default, no engine-native audit fields are included.

    

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

    
    ::

      {
          'KmsKeyId': 'string',
          'KinesisStreamName': 'string',
          'Status': 'stopped'|'starting'|'started'|'stopping',
          'Mode': 'sync'|'async',
          'EngineNativeAuditFieldsIncluded': True|False,
          'ApplyImmediately': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **KmsKeyId** *(string) --* 

        The Amazon Web Services KMS key identifier for encryption of messages in the database activity stream.

        
      

      - **KinesisStreamName** *(string) --* 

        The name of the Amazon Kinesis data stream to be used for the database activity stream.

        
      

      - **Status** *(string) --* 

        The status of the database activity stream.

        
      

      - **Mode** *(string) --* 

        The mode of the database activity stream.

        
      

      - **EngineNativeAuditFieldsIncluded** *(boolean) --* 

        Indicates whether engine-native audit fields are included in the database activity stream.

        
      

      - **ApplyImmediately** *(boolean) --* 

        Indicates whether or not the database activity stream will start as soon as possible, regardless of the maintenance window for the database.

        
  
  **Exceptions**
  
  *   :py:class:`RDS.Client.exceptions.ResourceNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBInstanceNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.InvalidDBClusterStateFault`

  
  *   :py:class:`RDS.Client.exceptions.InvalidDBInstanceStateFault`

  
  *   :py:class:`RDS.Client.exceptions.KMSKeyNotAccessibleFault`

  
  *   :py:class:`RDS.Client.exceptions.DBClusterNotFoundFault`

  