Amazon Redshift

2022/04/19 - Amazon Redshift - 3 updated api methods

Changes  Introduces new fields for LogDestinationType and LogExports on EnableLogging requests and Enable/Disable/DescribeLogging responses. Customers can now select CloudWatch Logs as a destination for their Audit Logs.

DescribeLoggingStatus (updated) Link ¶
Changes (response)
{'LogDestinationType': 's3 | cloudwatch', 'LogExports': ['string']}

Describes whether information, such as queries and connection attempts, is being logged for the specified Amazon Redshift cluster.

See also: AWS API Documentation

Request Syntax

client.describe_logging_status(
    ClusterIdentifier='string'
)
type ClusterIdentifier

string

param ClusterIdentifier

[REQUIRED]

The identifier of the cluster from which to get the logging status.

Example: examplecluster

rtype

dict

returns

Response Syntax

{
    'LoggingEnabled': True|False,
    'BucketName': 'string',
    'S3KeyPrefix': 'string',
    'LastSuccessfulDeliveryTime': datetime(2015, 1, 1),
    'LastFailureTime': datetime(2015, 1, 1),
    'LastFailureMessage': 'string',
    'LogDestinationType': 's3'|'cloudwatch',
    'LogExports': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Describes the status of logging for a cluster.

    • LoggingEnabled (boolean) --

      true if logging is on, false if logging is off.

    • BucketName (string) --

      The name of the S3 bucket where the log files are stored.

    • S3KeyPrefix (string) --

      The prefix applied to the log file names.

    • LastSuccessfulDeliveryTime (datetime) --

      The last time that logs were delivered.

    • LastFailureTime (datetime) --

      The last time when logs failed to be delivered.

    • LastFailureMessage (string) --

      The message indicating that logs failed to be delivered.

    • LogDestinationType (string) --

      The log destination type. An enum with possible values of s3 and cloudwatch .

    • LogExports (list) --

      The collection of exported log types. Log types include the connection log, user log and user activity log.

      • (string) --

DisableLogging (updated) Link ¶
Changes (response)
{'LogDestinationType': 's3 | cloudwatch', 'LogExports': ['string']}

Stops logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.

See also: AWS API Documentation

Request Syntax

client.disable_logging(
    ClusterIdentifier='string'
)
type ClusterIdentifier

string

param ClusterIdentifier

[REQUIRED]

The identifier of the cluster on which logging is to be stopped.

Example: examplecluster

rtype

dict

returns

Response Syntax

{
    'LoggingEnabled': True|False,
    'BucketName': 'string',
    'S3KeyPrefix': 'string',
    'LastSuccessfulDeliveryTime': datetime(2015, 1, 1),
    'LastFailureTime': datetime(2015, 1, 1),
    'LastFailureMessage': 'string',
    'LogDestinationType': 's3'|'cloudwatch',
    'LogExports': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Describes the status of logging for a cluster.

    • LoggingEnabled (boolean) --

      true if logging is on, false if logging is off.

    • BucketName (string) --

      The name of the S3 bucket where the log files are stored.

    • S3KeyPrefix (string) --

      The prefix applied to the log file names.

    • LastSuccessfulDeliveryTime (datetime) --

      The last time that logs were delivered.

    • LastFailureTime (datetime) --

      The last time when logs failed to be delivered.

    • LastFailureMessage (string) --

      The message indicating that logs failed to be delivered.

    • LogDestinationType (string) --

      The log destination type. An enum with possible values of s3 and cloudwatch .

    • LogExports (list) --

      The collection of exported log types. Log types include the connection log, user log and user activity log.

      • (string) --

EnableLogging (updated) Link ¶
Changes (both)
{'LogDestinationType': 's3 | cloudwatch', 'LogExports': ['string']}

Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.

See also: AWS API Documentation

Request Syntax

client.enable_logging(
    ClusterIdentifier='string',
    BucketName='string',
    S3KeyPrefix='string',
    LogDestinationType='s3'|'cloudwatch',
    LogExports=[
        'string',
    ]
)
type ClusterIdentifier

string

param ClusterIdentifier

[REQUIRED]

The identifier of the cluster on which logging is to be started.

Example: examplecluster

type BucketName

string

param BucketName

The name of an existing S3 bucket where the log files are to be stored.

Constraints:

  • Must be in the same region as the cluster

  • The cluster must have read bucket and put object permissions

type S3KeyPrefix

string

param S3KeyPrefix

The prefix applied to the log file names.

Constraints:

  • Cannot exceed 512 characters

  • Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (), or control characters. The hexadecimal codes for invalid characters are:

    • x00 to x20

    • x22

    • x27

    • x5c

    • x7f or larger

type LogDestinationType

string

param LogDestinationType

The log destination type. An enum with possible values of s3 and cloudwatch .

type LogExports

list

param LogExports

The collection of exported log types. Log types include the connection log, user log and user activity log.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'LoggingEnabled': True|False,
    'BucketName': 'string',
    'S3KeyPrefix': 'string',
    'LastSuccessfulDeliveryTime': datetime(2015, 1, 1),
    'LastFailureTime': datetime(2015, 1, 1),
    'LastFailureMessage': 'string',
    'LogDestinationType': 's3'|'cloudwatch',
    'LogExports': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Describes the status of logging for a cluster.

    • LoggingEnabled (boolean) --

      true if logging is on, false if logging is off.

    • BucketName (string) --

      The name of the S3 bucket where the log files are stored.

    • S3KeyPrefix (string) --

      The prefix applied to the log file names.

    • LastSuccessfulDeliveryTime (datetime) --

      The last time that logs were delivered.

    • LastFailureTime (datetime) --

      The last time when logs failed to be delivered.

    • LastFailureMessage (string) --

      The message indicating that logs failed to be delivered.

    • LogDestinationType (string) --

      The log destination type. An enum with possible values of s3 and cloudwatch .

    • LogExports (list) --

      The collection of exported log types. Log types include the connection log, user log and user activity log.

      • (string) --