def dryrun_eks_logging()

in subfunctions/ALE_dryrun_single.py [0:0]


def dryrun_eks_logging(region_list):
    """Function to turn on logging for EKS Clusters"""
    for aws_region in region_list:
        logging.info("Turning on audit and authenticator logging for EKS clusters in region " + aws_region + ".")
        eks = boto3.client('eks', region_name=aws_region)
        try:
            logging.info("ListClusters API Call")
            eks_clusters = eks.list_clusters()
            eks_cluster_list = eks_clusters ['clusters']
            logging.info("EKS Clusters found in " + aws_region + ":")
            print(eks_cluster_list)
            for cluster in eks_cluster_list:
                logging.info("Please check if Audit and Authenticator logs are on for EKS Cluster " + cluster)
        except Exception as exception_handle:
            logging.error(exception_handle)