enable_logging
¶
enable_logging(
*,
config_overrides: Optional[RedshiftClientConfig] = None,
cluster_identifier: Optional[String] = None,
bucket_name: Optional[String] = None,
s3_key_prefix: Optional[S3KeyPrefixValue] = None,
log_destination_type: Optional[LogDestinationType] = None,
log_exports: Optional[LogTypeList] = None,
s3_table_kms_key_id: Optional[String] = None,
s3_table_granularity: Optional[String] = None,
) -> LoggingStatus
Starts logging information, such as queries and connection attempts, for the specified Amazon Redshift cluster.
Parameters:
-
cluster_identifier(Optional[String], default:None) –The identifier of the cluster on which logging is to be started.
Example:
examplecluster -
bucket_name(Optional[String], default:None) –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
-
-
s3_key_prefix(Optional[S3KeyPrefixValue], default:None) –The prefix applied to the log file names.
Valid characters are any letter from any language, any whitespace character, any numeric character, and the following characters: underscore (
_), period (.), colon (:), slash (/), equal (=), plus (+), backslash (\), hyphen (-), at symbol (@). -
log_destination_type(Optional[LogDestinationType], default:None) –The log destination type. An enum with possible values of
s3,cloudwatch, ands3table. -
log_exports(Optional[LogTypeList], default:None) –The collection of exported log types. When
LogDestinationTypeiss3orcloudwatch, possible values areconnectionlog,useractivitylog, anduserlog. WhenLogDestinationTypeiss3table, the values are the names of the system tables to publish. Omitting this parameter, passing an empty list, or including the valueallpublishes all current and future system tables. -
s3_table_kms_key_id(Optional[String], default:None) –The identifier of a customer managed KMS key used to encrypt the S3 tables. This parameter is valid only when
LogDestinationTypeiss3table. -
s3_table_granularity(Optional[String], default:None) –The scope of system table publishing. Valid values are
clusterandaccount. A value ofclusterscopes publishing to the individual cluster. A value ofaccountscopes publishing to the Amazon Web Services account. This parameter is valid only whenLogDestinationTypeiss3table.
Raises:
-
BucketNotFoundFault–Could not find the specified S3 bucket.
-
ClusterNotFoundFault–The
ClusterIdentifierparameter does not refer to an existing cluster. -
InsufficientS3BucketPolicyFault–The cluster does not have read bucket or put object permissions on the S3 bucket specified when enabling logging.
-
InvalidClusterStateFault–The specified cluster is not in the
availablestate. -
InvalidS3BucketNameFault–The S3 bucket name is invalid. For more information about naming rules, go to Bucket Restrictions and Limitations in the Amazon Simple Storage Service (S3) Developer Guide.
-
InvalidS3KeyPrefixFault–The string specified for the logging S3 key prefix does not comply with the documented constraints.
-
UnsupportedOperationFault–The requested operation isn't supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift/_services/redshift.py
7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 | |