예제 #1
0
        public static bool RemoveAllCLoudWatchLogs(string functionName)
        {
            bool isEmpty;

            using (var cwClient = new AmazonCloudWatchLogsClient())
            {
                var logStreams = GetAllLogStreams(functionName, cwClient);
                Console.WriteLine("Deleting Log Streams");
                logStreams.ForEach(s => cwClient.DeleteLogStream(new DeleteLogStreamRequest("/aws/lambda/" + functionName, s.LogStreamName)));
                isEmpty = GetAllLogStreams(functionName, cwClient).Count == 0;
            }
            return(isEmpty);
        }