enable_logging
async
¶
enable_logging(
*,
config_overrides: Optional[AsyncRedshiftClientConfig] = 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/async_redshift.py
7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 | |