CognitoIdentityProvider / Client / set_log_delivery_configuration

set_log_delivery_configuration#

CognitoIdentityProvider.Client.set_log_delivery_configuration(**kwargs)#

Sets up or modifies the logging configuration of a user pool. User pools can export user notification logs and advanced security features user activity logs.

See also: AWS API Documentation

Request Syntax

response = client.set_log_delivery_configuration(
    UserPoolId='string',
    LogConfigurations=[
        {
            'LogLevel': 'ERROR'|'INFO',
            'EventSource': 'userNotification'|'userAuthEvents',
            'CloudWatchLogsConfiguration': {
                'LogGroupArn': 'string'
            },
            'S3Configuration': {
                'BucketArn': 'string'
            },
            'FirehoseConfiguration': {
                'StreamArn': 'string'
            }
        },
    ]
)
Parameters:
  • UserPoolId (string) –

    [REQUIRED]

    The ID of the user pool where you want to configure logging.

  • LogConfigurations (list) –

    [REQUIRED]

    A collection of the logging configurations for a user pool.

    • (dict) –

      The logging parameters of a user pool.

      • LogLevel (string) – [REQUIRED]

        The errorlevel selection of logs that a user pool sends for detailed activity logging. To send userNotification activity with information about message delivery, choose ERROR with CloudWatchLogsConfiguration. To send userAuthEvents activity with user logs from advanced security features, choose INFO with one of CloudWatchLogsConfiguration, FirehoseConfiguration, or S3Configuration.

      • EventSource (string) – [REQUIRED]

        The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to userNotification. To send info-level logs about advanced security features user activity, set to userAuthEvents.

      • CloudWatchLogsConfiguration (dict) –

        The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with advanced security features.

        • LogGroupArn (string) –

          The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool.

          To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with /aws/vendedlogs. For more information, see Enabling logging from certain Amazon Web Services services.

      • S3Configuration (dict) –

        The Amazon S3 bucket destination of user activity log export with advanced security features. To activate this setting, advanced security features must be active in your user pool.

        • BucketArn (string) –

          The ARN of an Amazon S3 bucket that’s the destination for advanced security features log export.

      • FirehoseConfiguration (dict) –

        The Amazon Data Firehose stream destination of user activity log export with advanced security features. To activate this setting, advanced security features must be active in your user pool.

        • StreamArn (string) –

          The ARN of an Amazon Data Firehose stream that’s the destination for advanced security features log export.

Return type:

dict

Returns:

Response Syntax

{
    'LogDeliveryConfiguration': {
        'UserPoolId': 'string',
        'LogConfigurations': [
            {
                'LogLevel': 'ERROR'|'INFO',
                'EventSource': 'userNotification'|'userAuthEvents',
                'CloudWatchLogsConfiguration': {
                    'LogGroupArn': 'string'
                },
                'S3Configuration': {
                    'BucketArn': 'string'
                },
                'FirehoseConfiguration': {
                    'StreamArn': 'string'
                }
            },
        ]
    }
}

Response Structure

  • (dict) –

    • LogDeliveryConfiguration (dict) –

      The detailed activity logging configuration that you applied to the requested user pool.

      • UserPoolId (string) –

        The ID of the user pool where you configured logging.

      • LogConfigurations (list) –

        A logging destination of a user pool. User pools can have multiple logging destinations for message-delivery and user-activity logs.

        • (dict) –

          The logging parameters of a user pool.

          • LogLevel (string) –

            The errorlevel selection of logs that a user pool sends for detailed activity logging. To send userNotification activity with information about message delivery, choose ERROR with CloudWatchLogsConfiguration. To send userAuthEvents activity with user logs from advanced security features, choose INFO with one of CloudWatchLogsConfiguration, FirehoseConfiguration, or S3Configuration.

          • EventSource (string) –

            The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to userNotification. To send info-level logs about advanced security features user activity, set to userAuthEvents.

          • CloudWatchLogsConfiguration (dict) –

            The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with advanced security features.

            • LogGroupArn (string) –

              The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool.

              To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with /aws/vendedlogs. For more information, see Enabling logging from certain Amazon Web Services services.

          • S3Configuration (dict) –

            The Amazon S3 bucket destination of user activity log export with advanced security features. To activate this setting, advanced security features must be active in your user pool.

            • BucketArn (string) –

              The ARN of an Amazon S3 bucket that’s the destination for advanced security features log export.

          • FirehoseConfiguration (dict) –

            The Amazon Data Firehose stream destination of user activity log export with advanced security features. To activate this setting, advanced security features must be active in your user pool.

            • StreamArn (string) –

              The ARN of an Amazon Data Firehose stream that’s the destination for advanced security features log export.

Exceptions

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException

  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException